graphbrainz/src/types/event.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-08-20 05:59:32 +00:00
import { GraphQLObjectType, GraphQLString, GraphQLBoolean } from 'graphql/type'
2016-08-31 06:33:29 +00:00
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,
aliases,
lifeSpan,
relationships,
tags,
2016-11-28 14:43:32 +00:00
connectionWithExtras
2016-08-20 05:59:32 +00:00
} from './helpers'
const Event = new GraphQLObjectType({
name: 'Event',
2016-11-26 01:38:32 +00:00
description: `An [event](https://musicbrainz.org/doc/Event) refers to an
organised event which people can attend, and is relevant to MusicBrainz.
Generally this means 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,
aliases,
2016-08-20 05:59:32 +00:00
lifeSpan,
2016-11-26 01:38:32 +00:00
time: {
type: Time,
description: 'The start time of the event.'
},
cancelled: {
type: GraphQLBoolean,
description: 'Whether or not the event took place.'
},
setlist: {
type: GraphQLString,
description: `A list of songs performed, optionally including links to
artists and works. See the [setlist documentation](https://musicbrainz.org/doc/Event/Setlist)
for syntax and examples.`
},
...fieldWithID('type', {
description: 'What kind of event the event is, e.g. concert, festival, etc.'
}),
relationships,
tags
2016-08-20 05:59:32 +00:00
})
})
2016-11-28 14:43:32 +00:00
export const EventConnection = connectionWithExtras(Event)
2016-08-20 05:59:32 +00:00
export default Event