graphbrainz/src/types/entity.js
Brian Beck 8759943638 wip
2016-08-30 23:33:29 -07:00

15 lines
393 B
JavaScript

import { GraphQLInterfaceType } from 'graphql'
import { mbid } from './helpers'
export default new GraphQLInterfaceType({
name: 'Entity',
description: 'An entity in the MusicBrainz schema.',
resolveType (value) {
if (value.entityType && require.resolve(`./${value.entityType}`)) {
return require(`./${value.entityType}`).default
}
},
fields: () => ({
mbid
})
})