mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
15 lines
393 B
JavaScript
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
|
|
})
|
|
})
|