mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
38 lines
710 B
JavaScript
38 lines
710 B
JavaScript
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql/type'
|
|
import Entity from './entity'
|
|
import {
|
|
id,
|
|
name,
|
|
sortName,
|
|
disambiguation,
|
|
artists,
|
|
events,
|
|
labels,
|
|
places,
|
|
releases,
|
|
createPageType
|
|
} from './helpers'
|
|
|
|
const Area = new GraphQLObjectType({
|
|
name: 'Area',
|
|
description: 'A country, region, city or the like.',
|
|
interfaces: () => [Entity],
|
|
fields: () => ({
|
|
id,
|
|
name,
|
|
sortName,
|
|
disambiguation,
|
|
isoCodes: {
|
|
type: new GraphQLList(GraphQLString),
|
|
resolve: data => data['iso-3166-1-codes']
|
|
},
|
|
artists,
|
|
events,
|
|
labels,
|
|
places,
|
|
releases
|
|
})
|
|
})
|
|
|
|
export const AreaPage = createPageType(Area)
|
|
export default Area
|