mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
13 lines
372 B
JavaScript
13 lines
372 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._type && require.resolve(`./${value._type}`)) {
|
|
return require(`./${value._type}`).default
|
|
}
|
|
},
|
|
fields: () => ({ mbid })
|
|
})
|