graphbrainz/src/types/media.js

32 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-12-12 09:01:40 +00:00
import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql/type'
import { resolveHyphenated, fieldWithID } from './helpers'
export default new GraphQLObjectType({
name: 'Medium',
description: `A medium is the actual physical medium the audio content is
stored upon. This means that each CD in a multi-disc release will be entered as
separate mediums within the release, and that both sides of a vinyl record or
cassette will exist on one medium. Mediums have a format (e.g. CD, DVD, vinyl,
cassette) and can optionally also have a title.`,
fields: () => ({
title: {
type: GraphQLString,
description: 'The title of this particular medium.'
},
...fieldWithID('format', {
description: `The [format](https://musicbrainz.org/doc/Release/Format) of
the medium (e.g. CD, DVD, vinyl, cassette).`
}),
position: {
type: GraphQLInt,
description: `The order of this medium in the release (for example, in a
multi-disc release).`
},
trackCount: {
type: GraphQLInt,
description: 'The number of audio tracks on this medium.',
resolve: resolveHyphenated
}
})
})