graphbrainz/src/types/entity.js

16 lines
393 B
JavaScript
Raw Normal View History

2016-08-31 06:33:29 +00:00
import { GraphQLInterfaceType } from 'graphql'
import { mbid } from './helpers'
2016-08-08 07:54:06 +00:00
export default new GraphQLInterfaceType({
name: 'Entity',
2016-08-20 05:59:32 +00:00
description: 'An entity in the MusicBrainz schema.',
resolveType (value) {
if (value.entityType && require.resolve(`./${value.entityType}`)) {
return require(`./${value.entityType}`).default
}
},
2016-08-08 07:54:06 +00:00
fields: () => ({
2016-08-31 06:33:29 +00:00
mbid
2016-08-08 07:54:06 +00:00
})
})