mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Merge pull request #5 from exogen/add-artist-ipis-isnis
Add list of IPIs and ISNIs to Artist
This commit is contained in:
commit
090a6e4629
7 changed files with 128 additions and 27 deletions
|
|
@ -177,6 +177,14 @@ type Artist implements Node, Entity {
|
||||||
# field.
|
# field.
|
||||||
typeID: MBID
|
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.
|
# A list of recordings linked to this entity.
|
||||||
recordings(after: String, first: Int): RecordingConnection
|
recordings(after: String, first: Int): RecordingConnection
|
||||||
|
|
||||||
|
|
@ -587,11 +595,16 @@ type InstrumentEdge {
|
||||||
score: Int
|
score: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
# An [IPI](https://musicbrainz.org/doc/IPI) (interested party
|
# An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
|
||||||
# information) code is an identifying number assigned by the CISAC database for
|
# (IPI) code is an identifying number assigned by the CISAC database for musical
|
||||||
# musical rights management.
|
# rights management.
|
||||||
scalar IPI
|
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
|
# [Labels](https://musicbrainz.org/doc/Label) represent mostly
|
||||||
# (but not only) imprints. To a lesser extent, a label entity may be created to
|
# (but not only) imprints. To a lesser extent, a label entity may be created to
|
||||||
# represent a record company.
|
# represent a record company.
|
||||||
|
|
@ -631,8 +644,8 @@ type Label implements Node, Entity {
|
||||||
# of the label.
|
# of the label.
|
||||||
labelCode: Int
|
labelCode: Int
|
||||||
|
|
||||||
# List of IPI (interested party information) codes for the
|
# List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
|
||||||
# label.
|
# codes for the label.
|
||||||
ipis: [IPI]
|
ipis: [IPI]
|
||||||
|
|
||||||
# A type describing the main activity of the label, e.g.
|
# A type describing the main activity of the label, e.g.
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ You may also be interested in reading the [schema in GraphQL syntax](schema.md).
|
||||||
<li>[Degrees](#degrees)</li>
|
<li>[Degrees](#degrees)</li>
|
||||||
<li>[ID](#id)</li>
|
<li>[ID](#id)</li>
|
||||||
<li>[IPI](#ipi)</li>
|
<li>[IPI](#ipi)</li>
|
||||||
|
<li>[ISNI](#isni)</li>
|
||||||
<li>[Int](#int)</li>
|
<li>[Int](#int)</li>
|
||||||
<li>[Locale](#locale)</li>
|
<li>[Locale](#locale)</li>
|
||||||
<li>[MBID](#mbid)</li>
|
<li>[MBID](#mbid)</li>
|
||||||
|
|
@ -487,6 +488,18 @@ field.</td>
|
||||||
<td valign="top"><a href="#mbid">MBID</a></td>
|
<td valign="top"><a href="#mbid">MBID</a></td>
|
||||||
<td>The MBID associated with the value of the <code>type</code>
|
<td>The MBID associated with the value of the <code>type</code>
|
||||||
field.</td>
|
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>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><strong>recordings</strong></td>
|
<td valign="top"><strong>recordings</strong></td>
|
||||||
|
|
@ -1388,8 +1401,8 @@ of the label.</td>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><strong>ipis</strong></td>
|
<td valign="top"><strong>ipis</strong></td>
|
||||||
<td valign="top">[<a href="#ipi">IPI</a>]</td>
|
<td valign="top">[<a href="#ipi">IPI</a>]</td>
|
||||||
<td>List of IPI (interested party information) codes for the
|
<td>List of <a href="https://musicbrainz.org/doc/IPI">Interested Parties Information</a>
|
||||||
label.</td>
|
codes for the label.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><strong>type</strong></td>
|
<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
|
### IPI
|
||||||
|
|
||||||
An [IPI](https://musicbrainz.org/doc/IPI) (interested party
|
An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
|
||||||
information) code is an identifying number assigned by the CISAC database for
|
(IPI) code is an identifying number assigned by the CISAC database for musical
|
||||||
musical rights management.
|
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
|
### Int
|
||||||
|
|
||||||
|
|
|
||||||
64
schema.json
64
schema.json
|
|
@ -1471,6 +1471,38 @@
|
||||||
"isDeprecated": false,
|
"isDeprecated": false,
|
||||||
"deprecationReason": null
|
"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",
|
"name": "recordings",
|
||||||
"description": "A list of recordings linked to this entity.",
|
"description": "A list of recordings linked to this entity.",
|
||||||
|
|
@ -1764,6 +1796,26 @@
|
||||||
"enumValues": null,
|
"enumValues": null,
|
||||||
"possibleTypes": 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",
|
"kind": "OBJECT",
|
||||||
"name": "RecordingConnection",
|
"name": "RecordingConnection",
|
||||||
|
|
@ -3153,7 +3205,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ipis",
|
"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": [],
|
"args": [],
|
||||||
"type": {
|
"type": {
|
||||||
"kind": "LIST",
|
"kind": "LIST",
|
||||||
|
|
@ -3314,16 +3366,6 @@
|
||||||
"enumValues": null,
|
"enumValues": null,
|
||||||
"possibleTypes": 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",
|
"kind": "OBJECT",
|
||||||
"name": "Relationships",
|
"name": "Relationships",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { GraphQLObjectType, GraphQLString } from 'graphql/type'
|
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql/type'
|
||||||
import Node from './node'
|
import Node from './node'
|
||||||
import Entity from './entity'
|
import Entity from './entity'
|
||||||
import Area from './area'
|
import Area from './area'
|
||||||
|
import { IPI, ISNI } from './scalars'
|
||||||
import {
|
import {
|
||||||
resolveWithFallback,
|
resolveWithFallback,
|
||||||
fieldWithID,
|
fieldWithID,
|
||||||
|
|
@ -66,6 +67,16 @@ neither. Groups do not have genders.`
|
||||||
...fieldWithID('type', {
|
...fieldWithID('type', {
|
||||||
description: 'Whether an artist is a person, a group, or something else.'
|
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,
|
recordings,
|
||||||
releases,
|
releases,
|
||||||
releaseGroups,
|
releaseGroups,
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ of the label.`
|
||||||
},
|
},
|
||||||
ipis: {
|
ipis: {
|
||||||
type: new GraphQLList(IPI),
|
type: new GraphQLList(IPI),
|
||||||
description: `List of IPI (interested party information) codes for the
|
description: `List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)
|
||||||
label.`
|
codes for the label.`
|
||||||
},
|
},
|
||||||
...fieldWithID('type', {
|
...fieldWithID('type', {
|
||||||
description: `A type describing the main activity of the label, e.g.
|
description: `A type describing the main activity of the label, e.g.
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,9 @@ export const Duration = createScalar({
|
||||||
|
|
||||||
export const IPI = createScalar({
|
export const IPI = createScalar({
|
||||||
name: 'IPI',
|
name: 'IPI',
|
||||||
description: `An [IPI](https://musicbrainz.org/doc/IPI) (interested party
|
description: `An [Interested Parties Information](https://musicbrainz.org/doc/IPI)
|
||||||
information) code is an identifying number assigned by the CISAC database for
|
(IPI) code is an identifying number assigned by the CISAC database for musical
|
||||||
musical rights management.`
|
rights management.`
|
||||||
})
|
})
|
||||||
|
|
||||||
export const ISNI = createScalar({
|
export const ISNI = createScalar({
|
||||||
|
|
|
||||||
|
|
@ -463,3 +463,19 @@ test('Releases have an ASIN field', testData,
|
||||||
const { release } = data.lookup
|
const { release } = data.lookup
|
||||||
t.is(release.asin, 'B01KN6XDS6')
|
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'])
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue