graphbrainz/src/types/instrument.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-08-20 05:59:32 +00:00
import { GraphQLObjectType, GraphQLString } 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 {
fieldWithID,
id,
2016-08-31 06:33:29 +00:00
mbid,
2016-08-20 05:59:32 +00:00
name,
disambiguation,
aliases,
relationships,
collections,
tags,
2016-11-28 14:43:32 +00:00
connectionWithExtras
2016-08-20 05:59:32 +00:00
} from './helpers'
const Instrument = new GraphQLObjectType({
name: 'Instrument',
2016-11-26 01:38:32 +00:00
description: `[Instruments](https://musicbrainz.org/doc/Instrument) are
devices created or adapted to make musical sounds. Instruments are primarily
used in relationships between two other entities.`,
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-11-26 01:38:32 +00:00
description: {
type: GraphQLString,
description: `A brief description of the main characteristics of the
instrument.`
},
...fieldWithID('type', {
description: `The type categorises the instrument by the way the sound is
created, similar to the [Hornbostel-Sachs](https://en.wikipedia.org/wiki/Hornbostel%E2%80%93Sachs)
classification.`
}),
relationships,
collections,
tags
2016-08-20 05:59:32 +00:00
})
})
2016-11-28 14:43:32 +00:00
export const InstrumentConnection = connectionWithExtras(Instrument)
2016-08-20 05:59:32 +00:00
export default Instrument