mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
21 lines
592 B
JavaScript
21 lines
592 B
JavaScript
|
|
import {
|
||
|
|
GraphQLObjectType,
|
||
|
|
GraphQLNonNull,
|
||
|
|
GraphQLString,
|
||
|
|
GraphQLList
|
||
|
|
} from 'graphql/type'
|
||
|
|
import MBID from './mbid'
|
||
|
|
import { getHyphenated } from './helpers'
|
||
|
|
|
||
|
|
export default new GraphQLObjectType({
|
||
|
|
name: 'Area',
|
||
|
|
description: 'A country, region, city or the like.',
|
||
|
|
fields: () => ({
|
||
|
|
id: { type: new GraphQLNonNull(MBID) },
|
||
|
|
disambiguation: { type: GraphQLString },
|
||
|
|
name: { type: GraphQLString },
|
||
|
|
sortName: { type: GraphQLString, resolve: getHyphenated },
|
||
|
|
isoCodes: { type: new GraphQLList(GraphQLString), resolve: data => data['iso-3166-1-codes'] }
|
||
|
|
})
|
||
|
|
})
|