graphbrainz/src/types/release.js
Brian Beck b2ec20ed2c Rename artistCredit fields to artistCredits (#9)
* Rename artistCredit field to artistCredits
* Update deprecation rendering
2016-12-11 12:32:58 -08:00

94 lines
2.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql/type'
import Node from './node'
import Entity from './entity'
import { ASIN, DateType } from './scalars'
import { ReleaseStatus } from './enums'
import ReleaseEvent from './release-event'
import {
id,
mbid,
title,
disambiguation,
aliases,
artistCredit,
artistCredits,
artists,
labels,
recordings,
releaseGroups,
relationships,
tags,
fieldWithID,
resolveHyphenated,
connectionWithExtras
} from './helpers'
const Release = new GraphQLObjectType({
name: 'Release',
description: `A [release](https://musicbrainz.org/doc/Release) represents the
unique release (i.e. issuing) of a product on a specific date with specific
release information such as the country, label, barcode, packaging, etc. If you
walk into a store and purchase an album or single, theyre each represented in
MusicBrainz as one release.`,
interfaces: () => [Node, Entity],
fields: () => ({
id,
mbid,
title,
disambiguation,
aliases,
artistCredit,
artistCredits,
releaseEvents: {
type: new GraphQLList(ReleaseEvent),
description: 'The release events for this release.',
resolve: resolveHyphenated
},
date: {
type: DateType,
description: `The [release date](https://musicbrainz.org/doc/Release/Date)
is the date in which a release was made available through some sort of
distribution mechanism.`
},
country: {
type: GraphQLString,
description: 'The country in which the release was issued.'
},
asin: {
type: ASIN,
description: `The [Amazon Standard Identification Number](https://musicbrainz.org/doc/ASIN)
of the release.`
},
barcode: {
type: GraphQLString,
description: `The [barcode](https://en.wikipedia.org/wiki/Barcode), if the
release has one. The most common types found on releases are 12-digit
[UPCs](https://en.wikipedia.org/wiki/Universal_Product_Code) and 13-digit
[EANs](https://en.wikipedia.org/wiki/International_Article_Number).`
},
...fieldWithID('status', {
type: ReleaseStatus,
description: 'The status describes how “official” a release is.'
}),
...fieldWithID('packaging', {
description: `The physical packaging that accompanies the release. See
the [list of packaging](https://musicbrainz.org/doc/Release/Packaging) for more
information.`
}),
quality: {
type: GraphQLString,
description: `Data quality indicates how good the data for a release is.
It is not a mark of how good or bad the music itself is for that, use
[ratings](https://musicbrainz.org/doc/Rating_System).`
},
artists,
labels,
recordings,
releaseGroups,
relationships,
tags
})
})
export const ReleaseConnection = connectionWithExtras(Release)
export default Release