Merge pull request #5 from exogen/add-artist-ipis-isnis

Add list of IPIs and ISNIs to Artist
This commit is contained in:
Brian Beck 2016-12-10 09:55:45 -08:00 committed by GitHub
commit 090a6e4629
7 changed files with 128 additions and 27 deletions

View file

@ -177,6 +177,14 @@ type Artist implements Node, Entity {
# field.
typeID: MBID
# List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
# (IPI) codes for the artist.
ipis: [IPI]
# List of [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)
# (ISNI) codes for the artist.
isnis: [ISNI]
# A list of recordings linked to this entity.
recordings(after: String, first: Int): RecordingConnection
@ -587,11 +595,16 @@ type InstrumentEdge {
score: Int
}
# An [IPI](https://musicbrainz.org/doc/IPI) (interested party
# information) code is an identifying number assigned by the CISAC database for
# musical rights management.
# An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
# (IPI) code is an identifying number assigned by the CISAC database for musical
# rights management.
scalar IPI
# The [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)
# (ISNI) is an ISO standard for uniquely identifying the public identities of
# contributors to media content.
scalar ISNI
# [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.
@ -631,8 +644,8 @@ type Label implements Node, Entity {
# of the label.
labelCode: Int
# List of IPI (interested party information) codes for the
# label.
# List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
# codes for the label.
ipis: [IPI]
# A type describing the main activity of the label, e.g.

View file

@ -67,6 +67,7 @@ You may also be interested in reading the [schema in GraphQL syntax](schema.md).
<li>[Degrees](#degrees)</li>
<li>[ID](#id)</li>
<li>[IPI](#ipi)</li>
<li>[ISNI](#isni)</li>
<li>[Int](#int)</li>
<li>[Locale](#locale)</li>
<li>[MBID](#mbid)</li>
@ -487,6 +488,18 @@ field.</td>
<td valign="top"><a href="#mbid">MBID</a></td>
<td>The MBID associated with the value of the <code>type</code>
field.</td>
</tr>
<tr>
<td valign="top"><strong>ipis</strong></td>
<td valign="top">[<a href="#ipi">IPI</a>]</td>
<td>List of <a href="https://musicbrainz.org/doc/IPI">Interested Parties Information</a>
(IPI) codes for the artist.</td>
</tr>
<tr>
<td valign="top"><strong>isnis</strong></td>
<td valign="top">[<a href="#isni">ISNI</a>]</td>
<td>List of <a href="https://musicbrainz.org/doc/ISNI">International Standard Name Identifier</a>
(ISNI) codes for the artist.</td>
</tr>
<tr>
<td valign="top"><strong>recordings</strong></td>
@ -1388,8 +1401,8 @@ of the label.</td>
<tr>
<td valign="top"><strong>ipis</strong></td>
<td valign="top">[<a href="#ipi">IPI</a>]</td>
<td>List of IPI (interested party information) codes for the
label.</td>
<td>List of <a href="https://musicbrainz.org/doc/IPI">Interested Parties Information</a>
codes for the label.</td>
</tr>
<tr>
<td valign="top"><strong>type</strong></td>
@ -3985,9 +3998,15 @@ The `ID` scalar type represents a unique identifier, often used to refetch an ob
### IPI
An [IPI](https://musicbrainz.org/doc/IPI) (interested party
information) code is an identifying number assigned by the CISAC database for
musical rights management.
An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
(IPI) code is an identifying number assigned by the CISAC database for musical
rights management.
### ISNI
The [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)
(ISNI) is an ISO standard for uniquely identifying the public identities of
contributors to media content.
### Int

View file

@ -1471,6 +1471,38 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ipis",
"description": "List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)\n(IPI) codes for the artist.",
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "IPI",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "isnis",
"description": "List of [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)\n(ISNI) codes for the artist.",
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ISNI",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "recordings",
"description": "A list of recordings linked to this entity.",
@ -1764,6 +1796,26 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "IPI",
"description": "An [Interested Parties Information](https://musicbrainz.org/doc/IPI)\n(IPI) code is an identifying number assigned by the CISAC database for musical\nrights management.",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "ISNI",
"description": "The [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)\n(ISNI) is an ISO standard for uniquely identifying the public identities of\ncontributors to media content.",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "RecordingConnection",
@ -3153,7 +3205,7 @@
},
{
"name": "ipis",
"description": "List of IPI (interested party information) codes for the\nlabel.",
"description": "List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)\ncodes for the label.",
"args": [],
"type": {
"kind": "LIST",
@ -3314,16 +3366,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "IPI",
"description": "An [IPI](https://musicbrainz.org/doc/IPI) (interested party\ninformation) code is an identifying number assigned by the CISAC database for\nmusical rights management.",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Relationships",

View file

@ -1,7 +1,8 @@
import { GraphQLObjectType, GraphQLString } from 'graphql/type'
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql/type'
import Node from './node'
import Entity from './entity'
import Area from './area'
import { IPI, ISNI } from './scalars'
import {
resolveWithFallback,
fieldWithID,
@ -66,6 +67,16 @@ neither. Groups do not have genders.`
...fieldWithID('type', {
description: 'Whether an artist is a person, a group, or something else.'
}),
ipis: {
type: new GraphQLList(IPI),
description: `List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
(IPI) codes for the artist.`
},
isnis: {
type: new GraphQLList(ISNI),
description: `List of [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)
(ISNI) codes for the artist.`
},
recordings,
releases,
releaseGroups,

View file

@ -52,8 +52,8 @@ of the label.`
},
ipis: {
type: new GraphQLList(IPI),
description: `List of IPI (interested party information) codes for the
label.`
description: `List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
codes for the label.`
},
...fieldWithID('type', {
description: `A type describing the main activity of the label, e.g.

View file

@ -80,9 +80,9 @@ export const Duration = createScalar({
export const IPI = createScalar({
name: 'IPI',
description: `An [IPI](https://musicbrainz.org/doc/IPI) (interested party
information) code is an identifying number assigned by the CISAC database for
musical rights management.`
description: `An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
(IPI) code is an identifying number assigned by the CISAC database for musical
rights management.`
})
export const ISNI = createScalar({

View file

@ -463,3 +463,19 @@ test('Releases have an ASIN field', testData,
const { release } = data.lookup
t.is(release.asin, 'B01KN6XDS6')
})
test('Artists have a list of ISNIs and IPIs', testData,
`
{
lookup {
artist(mbid: "65314b12-0e08-43fa-ba33-baaa7b874c15") {
ipis
isnis
}
}
}
`, (t, data) => {
const { artist } = data.lookup
t.deepEqual(artist.ipis, ['00006457004'])
t.deepEqual(artist.isnis, ['0000000110273481'])
})