2016-08-20 05:59:32 +00:00
|
|
|
import { GraphQLObjectType, GraphQLString, GraphQLBoolean } from 'graphql/type'
|
2016-08-31 06:33:29 +00:00
|
|
|
import { connectionDefinitions } from 'graphql-relay'
|
|
|
|
|
import Node from './node'
|
2016-08-20 05:59:32 +00:00
|
|
|
import Entity from './entity'
|
|
|
|
|
import { Time } from './scalars'
|
|
|
|
|
import {
|
|
|
|
|
fieldWithID,
|
|
|
|
|
id,
|
2016-08-31 06:33:29 +00:00
|
|
|
mbid,
|
2016-08-20 05:59:32 +00:00
|
|
|
name,
|
|
|
|
|
disambiguation,
|
2016-08-31 06:33:29 +00:00
|
|
|
lifeSpan
|
2016-08-20 05:59:32 +00:00
|
|
|
} from './helpers'
|
|
|
|
|
|
|
|
|
|
const Event = new GraphQLObjectType({
|
|
|
|
|
name: 'Event',
|
|
|
|
|
description:
|
|
|
|
|
'An organized event which people can attend, usually live performances ' +
|
|
|
|
|
'like concerts and festivals.',
|
2016-08-31 06:33:29 +00:00
|
|
|
interfaces: () => [Node, Entity],
|
2016-08-20 05:59:32 +00:00
|
|
|
fields: () => ({
|
|
|
|
|
id,
|
2016-08-31 06:33:29 +00:00
|
|
|
mbid,
|
2016-08-20 05:59:32 +00:00
|
|
|
name,
|
|
|
|
|
disambiguation,
|
|
|
|
|
lifeSpan,
|
|
|
|
|
time: { type: Time },
|
|
|
|
|
cancelled: { type: GraphQLBoolean },
|
|
|
|
|
setlist: { type: GraphQLString },
|
|
|
|
|
...fieldWithID('type')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
2016-08-31 06:33:29 +00:00
|
|
|
const { connectionType: EventConnection } = connectionDefinitions({ nodeType: Event })
|
|
|
|
|
export { EventConnection }
|
2016-08-20 05:59:32 +00:00
|
|
|
export default Event
|