graphbrainz/src/types/artist-credit.js

23 lines
595 B
JavaScript
Raw Normal View History

2016-08-08 07:54:06 +00:00
import { GraphQLObjectType, GraphQLString } from 'graphql/type'
2016-08-20 05:59:32 +00:00
import Artist from './artist'
import { name } from './helpers'
2016-08-08 07:54:06 +00:00
export default new GraphQLObjectType({
name: 'ArtistCredit',
description:
'Artist, variation of artist name and piece of text to join the artist ' +
'name to the next.',
fields: () => ({
2016-08-20 05:59:32 +00:00
artist: {
type: Artist,
resolve: (source) => {
const { artist } = source
artist.entityType = 'artist'
return artist
}
},
name,
2016-08-08 07:54:06 +00:00
joinPhrase: { type: GraphQLString, resolve: data => data['joinphrase'] }
})
})