graphbrainz/src/types/label.js

70 lines
1.5 KiB
JavaScript
Raw Normal View History

2016-08-20 05:59:32 +00:00
import {
GraphQLObjectType,
GraphQLList,
GraphQLString,
GraphQLInt
} 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 { IPI } from './scalars'
import Area from './area'
import {
id,
2016-08-31 06:33:29 +00:00
mbid,
2016-08-20 05:59:32 +00:00
name,
sortName,
disambiguation,
aliases,
2016-08-20 05:59:32 +00:00
lifeSpan,
releases,
relationships,
tags,
fieldWithID,
connectionWithCount
2016-08-20 05:59:32 +00:00
} from './helpers'
const Label = new GraphQLObjectType({
name: 'Label',
2016-11-26 01:38:32 +00:00
description: `[Labels](https://musicbrainz.org/doc/Label) represent mostly
(but not only) imprints. To a lesser extent, a label entity may be created to
represent a record company.`,
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,
sortName,
disambiguation,
aliases,
2016-11-26 01:38:32 +00:00
country: {
type: GraphQLString,
description: 'The country of origin for the label.'
},
area: {
type: Area,
description: 'The area in which the label is based.'
},
2016-08-20 05:59:32 +00:00
lifeSpan,
2016-11-26 01:38:32 +00:00
labelCode: {
type: GraphQLInt,
description: `The [“LC” code](https://musicbrainz.org/doc/Label/Label_Code)
of the label.`
},
ipis: {
type: new GraphQLList(IPI),
description: `List of IPI (interested party information) codes for the
label.`
},
...fieldWithID('type', {
description: `A type describing the main activity of the label, e.g.
imprint, production, distributor, rights society, etc.`
}),
releases,
relationships,
tags
2016-08-20 05:59:32 +00:00
})
})
export const LabelConnection = connectionWithCount(Label)
2016-08-20 05:59:32 +00:00
export default Label