mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Support fetching ISRCs for nested recording entites (#75)
This commit is contained in:
parent
ba21977847
commit
01ebffad01
1 changed files with 12 additions and 1 deletions
|
|
@ -45,7 +45,18 @@ or mixing.`,
|
|||
isrcs: {
|
||||
type: new GraphQLList(ISRC),
|
||||
description: `A list of [International Standard Recording Codes](https://musicbrainz.org/doc/ISRC)
|
||||
(ISRCs) for this recording.`
|
||||
(ISRCs) for this recording.`,
|
||||
resolve: (source, args, context) => {
|
||||
if (source.isrcs) {
|
||||
return source.isrcs
|
||||
}
|
||||
// TODO: Add support for parent entities knowing to include this `inc`
|
||||
// parameter in their own calls by inspecting what fields are requested
|
||||
// or batching things at the loader level.
|
||||
return context.loaders.lookup
|
||||
.load(['recording', source.id, { inc: 'isrcs' }])
|
||||
.then(recording => recording.isrcs)
|
||||
}
|
||||
},
|
||||
length: {
|
||||
type: Duration,
|
||||
|
|
|
|||
Loading…
Reference in a new issue