graphbrainz/src/types/area.js

21 lines
592 B
JavaScript
Raw Normal View History

2016-08-08 07:54:06 +00:00
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'] }
})
})