graphbrainz/src/types/area.js

39 lines
710 B
JavaScript
Raw Normal View History

2016-08-20 05:59:32 +00:00
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql/type'
import Entity from './entity'
2016-08-08 07:54:06 +00:00
import {
2016-08-20 05:59:32 +00:00
id,
name,
sortName,
disambiguation,
artists,
events,
labels,
places,
releases,
createPageType
} from './helpers'
2016-08-08 07:54:06 +00:00
2016-08-20 05:59:32 +00:00
const Area = new GraphQLObjectType({
2016-08-08 07:54:06 +00:00
name: 'Area',
description: 'A country, region, city or the like.',
2016-08-20 05:59:32 +00:00
interfaces: () => [Entity],
2016-08-08 07:54:06 +00:00
fields: () => ({
2016-08-20 05:59:32 +00:00
id,
name,
sortName,
disambiguation,
isoCodes: {
type: new GraphQLList(GraphQLString),
resolve: data => data['iso-3166-1-codes']
},
artists,
events,
labels,
places,
releases
2016-08-08 07:54:06 +00:00
})
})
2016-08-20 05:59:32 +00:00
export const AreaPage = createPageType(Area)
export default Area