diff --git a/docs/schema.md b/docs/schema.md index 53c499f..886de8c 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -153,7 +153,7 @@ type Artist implements Node, Entity { area: Area # The area in which an artist began their career (or where - # were born, if the artist is a person). + # they were born, if the artist is a person). beginArea: Area # The area in which an artist ended their career (or where @@ -590,6 +590,28 @@ scalar Date # Decimal degrees, used for latitude and longitude. scalar Degrees +# Information about the physical CD and releases associated with a +# particular [disc ID](https://musicbrainz.org/doc/Disc_ID). +type Disc implements Node { + # The ID of an object + id: ID! + + # The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc. + discID: DiscID! + + # The number of offsets (tracks) on the disc. + offsetCount: Int! + + # The sector offset of each track on the disc. + offsets: [Int] + + # The sector offset of the lead-out (the end of the disc). + sectors: Int! + + # The list of releases linked to this disc ID. + releases(after: String, first: Int): ReleaseConnection +} + # [Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code # number which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release) # listing. @@ -928,6 +950,13 @@ type LookupQuery { mbid: MBID! ): Collection + # Look up a specific physical disc by its disc ID. + disc( + # The [disc ID](https://musicbrainz.org/doc/Disc_ID) + # of the disc. + discID: DiscID! + ): Disc + # Look up a specific event by its MBID. event( # The MBID of the entity. @@ -1019,6 +1048,9 @@ type Medium { # The number of audio tracks on this medium. trackCount: Int + + # A list of physical discs and their disc IDs for this medium. + discs: [Disc] } # An object with an ID diff --git a/docs/types.md b/docs/types.md index f016348..6d8c6d8 100644 --- a/docs/types.md +++ b/docs/types.md @@ -18,6 +18,7 @@ You may also be interested in reading the [schema in GraphQL syntax](schema.md).
  • [CollectionConnection](#collectionconnection)
  • [CollectionEdge](#collectionedge)
  • [Coordinates](#coordinates)
  • +
  • [Disc](#disc)
  • [Event](#event)
  • [EventConnection](#eventconnection)
  • [EventEdge](#eventedge)
  • @@ -555,7 +556,7 @@ is often, but not always, its birth/formation country. Area The area in which an artist began their career (or where -were born, if the artist is a person). +they were born, if the artist is a person). @@ -1656,6 +1657,72 @@ Geographic coordinates described with latitude and longitude. +### Disc + +Information about the physical CD and releases associated with a +particular [disc ID](https://musicbrainz.org/doc/Disc_ID). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Field / ArgumentTypeDescription
    id ID! + The ID of an object +
    discID DiscID! + The disc ID of this disc. +
    offsetCount Int! + The number of offsets (tracks) on the disc. +
    offsets [Int] + The sector offset of each track on the disc. +
    sectors Int! + The sector offset of the lead-out (the end of the disc). +
    releases ReleaseConnection + The list of releases linked to this disc ID. +
    afterString
    firstInt
    + ### Event An [event](https://musicbrainz.org/doc/Event) refers to an @@ -2399,6 +2466,19 @@ A lookup of an individual MusicBrainz entity by its MBID. MBID! The MBID of the entity. + + disc + Disc + + Look up a specific physical disc by its disc ID. + + + + discID + DiscID! + The disc ID +of the disc. + event Event @@ -2579,6 +2659,13 @@ multi-disc release). The number of audio tracks on this medium. + + discs + [Disc] + + A list of physical discs and their disc IDs for this medium. + + ### PageInfo diff --git a/schema.json b/schema.json index ce19f01..4e4da69 100644 --- a/schema.json +++ b/schema.json @@ -167,6 +167,33 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "disc", + "description": "Look up a specific physical disc by its disc ID.", + "args": [ + { + "name": "discID", + "description": "The [disc ID](https://musicbrainz.org/doc/Disc_ID)\nof the disc.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DiscID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Disc", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "event", "description": "Look up a specific event by its MBID.", @@ -898,6 +925,11 @@ "name": "Release", "ofType": null }, + { + "kind": "OBJECT", + "name": "Disc", + "ofType": null + }, { "kind": "OBJECT", "name": "Label", @@ -1459,7 +1491,7 @@ }, { "name": "beginArea", - "description": "The area in which an artist began their career (or where\nwere born, if the artist is a person).", + "description": "The area in which an artist began their career (or where\nthey were born, if the artist is a person).", "args": [], "type": { "kind": "OBJECT", @@ -3301,6 +3333,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "discs", + "description": "A list of physical discs and their disc IDs for this medium.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Disc", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -3308,6 +3356,146 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "Disc", + "description": "Information about the physical CD and releases associated with a\nparticular [disc ID](https://musicbrainz.org/doc/Disc_ID).", + "fields": [ + { + "name": "id", + "description": "The ID of an object", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discID", + "description": "The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DiscID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "offsetCount", + "description": "The number of offsets (tracks) on the disc.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "offsets", + "description": "The sector offset of each track on the disc.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sectors", + "description": "The sector offset of the lead-out (the end of the disc).", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "releases", + "description": "The list of releases linked to this disc ID.", + "args": [ + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ReleaseConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "DiscID", + "description": "[Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code\nnumber which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)\nlisting.\n\nA release may have any number of disc IDs, and a disc ID may be linked to\nmultiple releases. This is because disc ID calculation involves a hash of the\nframe offsets of the CD tracks.\n\nDifferent pressing of a CD often have slightly different frame offsets, and\nhence different disc IDs.\n\nConversely, two different CDs may happen to have exactly the same set of frame\noffsets and hence the same disc ID.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "LabelConnection", @@ -9138,16 +9326,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "SCALAR", - "name": "DiscID", - "description": "[Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code\nnumber which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)\nlisting.\n\nA release may have any number of disc IDs, and a disc ID may be linked to\nmultiple releases. This is because disc ID calculation involves a hash of the\nframe offsets of the CD tracks.\n\nDifferent pressing of a CD often have slightly different frame offsets, and\nhence different disc IDs.\n\nConversely, two different CDs may happen to have exactly the same set of frame\noffsets and hence the same disc ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, { "kind": "SCALAR", "name": "ISWC", diff --git a/src/queries/lookup.js b/src/queries/lookup.js index 4f01819..50277bf 100644 --- a/src/queries/lookup.js +++ b/src/queries/lookup.js @@ -1,10 +1,12 @@ -import { GraphQLObjectType } from 'graphql' +import { GraphQLObjectType, GraphQLNonNull } from 'graphql' import { resolveLookup } from '../resolvers' import { mbid, toWords } from '../types/helpers' import { Area, Artist, Collection, + Disc, + DiscID, Event, Instrument, Label, @@ -36,6 +38,20 @@ export const LookupQuery = new GraphQLObjectType({ area: createLookupField(Area), artist: createLookupField(Artist), collection: createLookupField(Collection), + disc: { + type: Disc, + description: 'Look up a specific physical disc by its disc ID.', + args: { + discID: { + type: new GraphQLNonNull(DiscID), + description: `The [disc ID](https://musicbrainz.org/doc/Disc_ID) +of the disc.` + } + }, + resolve: (root, { discID }, { loaders }, info) => { + return loaders.lookup.load(['discid', discID]) + } + }, event: createLookupField(Event), instrument: createLookupField(Instrument), label: createLookupField(Label), diff --git a/src/resolvers.js b/src/resolvers.js index 8f8b80c..0012aa4 100644 --- a/src/resolvers.js +++ b/src/resolvers.js @@ -38,20 +38,20 @@ export function includeRelationships (params, info, fragments = info.fragments) export function includeSubqueries (params, info, fragments = info.fragments) { const subqueryIncludes = { - aliases: 'aliases', - artistCredit: 'artist-credits', - artistCredits: 'artist-credits', - isrcs: 'isrcs', - media: 'media', - rating: 'ratings', - tags: 'tags' + aliases: ['aliases'], + artistCredit: ['artist-credits'], + artistCredits: ['artist-credits'], + isrcs: ['isrcs'], + media: ['media', 'discids'], + rating: ['ratings'], + tags: ['tags'] } let fields = getFields(info, fragments) const include = [] for (const key in subqueryIncludes) { if (fields[key]) { const value = subqueryIncludes[key] - include.push(value) + include.push(...value) } } params = { @@ -104,6 +104,13 @@ export function resolveBrowse (root, { let request if (discID) { request = loaders.lookup.load(['discid', discID, params]) + // If fetching releases by disc ID, they will already include the `media` + // and `discids` subqueries, and it is invalid to specify them. + if (params.inc) { + params.inc = params.inc.filter(value => { + return value !== 'media' && value !== 'discids' + }) + } } else if (isrc) { request = loaders.lookup.load(['isrc', isrc, params]) } else if (iswc) { @@ -193,7 +200,7 @@ export function createSubqueryResolver ({ inc, key } = {}, handler = value => va return (entity, args, { loaders }, info) => { key = key || toDashed(info.fieldName) let promise - if (key in entity || (entity._inc && entity._inc.indexOf(key) >= 0)) { + if (key in entity) { promise = Promise.resolve(entity) } else { const { _type: entityType, id } = entity @@ -203,3 +210,15 @@ export function createSubqueryResolver ({ inc, key } = {}, handler = value => va return promise.then(entity => handler(entity[key], args)) } } + +export function resolveDiscReleases (disc, args, context, info) { + const { releases } = disc + if (releases != null) { + return { + totalCount: releases.length, + ...connectionFromArray(releases, args) + } + } + args = { ...args, discID: disc.id } + return resolveBrowse(disc, args, context, info) +} diff --git a/src/types/disc.js b/src/types/disc.js new file mode 100644 index 0000000..1c89193 --- /dev/null +++ b/src/types/disc.js @@ -0,0 +1,46 @@ +import { + GraphQLObjectType, + GraphQLNonNull, + GraphQLList, + GraphQLInt +} from 'graphql/type' +import { forwardConnectionArgs } from 'graphql-relay' +import Node from './node' +import { DiscID } from './scalars' +import { ReleaseConnection } from './release' +import { resolveDiscReleases } from '../resolvers' +import { id, resolveHyphenated } from './helpers' + +export default new GraphQLObjectType({ + name: 'Disc', + description: `Information about the physical CD and releases associated with a +particular [disc ID](https://musicbrainz.org/doc/Disc_ID).`, + interfaces: () => [Node], + fields: () => ({ + id, + discID: { + type: new GraphQLNonNull(DiscID), + description: `The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.`, + resolve: disc => disc.id + }, + offsetCount: { + type: new GraphQLNonNull(GraphQLInt), + description: 'The number of offsets (tracks) on the disc.', + resolve: resolveHyphenated + }, + offsets: { + type: new GraphQLList(GraphQLInt), + description: 'The sector offset of each track on the disc.' + }, + sectors: { + type: new GraphQLNonNull(GraphQLInt), + description: 'The sector offset of the lead-out (the end of the disc).' + }, + releases: { + type: ReleaseConnection, + description: 'The list of releases linked to this disc ID.', + args: forwardConnectionArgs, + resolve: resolveDiscReleases + } + }) +}) diff --git a/src/types/index.js b/src/types/index.js index 5a9dbe2..b054640 100644 --- a/src/types/index.js +++ b/src/types/index.js @@ -5,6 +5,7 @@ export { default as Entity, EntityConnection } from './entity' export { default as Area, AreaConnection } from './area' export { default as Artist, ArtistConnection } from './artist' export { default as Collection, CollectionConnection } from './collection' +export { default as Disc } from './disc' export { default as Event, EventConnection } from './event' export { default as Instrument, InstrumentConnection } from './instrument' export { default as Label, LabelConnection } from './label' diff --git a/src/types/media.js b/src/types/media.js index abc43d0..60162c6 100644 --- a/src/types/media.js +++ b/src/types/media.js @@ -1,4 +1,10 @@ -import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql/type' +import { + GraphQLObjectType, + GraphQLList, + GraphQLString, + GraphQLInt +} from 'graphql/type' +import Disc from './disc' import { resolveHyphenated, fieldWithID } from './helpers' export default new GraphQLObjectType({ @@ -26,6 +32,10 @@ multi-disc release).` type: GraphQLInt, description: 'The number of audio tracks on this medium.', resolve: resolveHyphenated + }, + discs: { + type: new GraphQLList(Disc), + description: 'A list of physical discs and their disc IDs for this medium.' } }) }) diff --git a/src/types/node.js b/src/types/node.js index 35d8124..427d004 100644 --- a/src/types/node.js +++ b/src/types/node.js @@ -3,6 +3,10 @@ import { toDashed } from './helpers' const debug = require('debug')('graphbrainz:types/node') +const TYPE_MODULES = { + discid: 'disc' +} + const { nodeInterface, nodeField } = nodeDefinitions( (globalID, { loaders }) => { const { type, id } = fromGlobalId(globalID) @@ -10,10 +14,11 @@ const { nodeInterface, nodeField } = nodeDefinitions( return loaders.lookup.load([entityType, id]) }, (obj) => { + const type = TYPE_MODULES[obj._type] || obj._type try { - return require(`./${obj._type}`).default + return require(`./${type}`).default } catch (err) { - debug(`Failed to load type: ${obj._type}`) + debug(`Failed to load type: ${type}`) return null } } diff --git a/test/fixtures/09cfb1f92b3dd549c5bedb798a351677 b/test/fixtures/09cfb1f92b3dd549c5bedb798a351677 new file mode 100644 index 0000000..45c46e2 Binary files /dev/null and b/test/fixtures/09cfb1f92b3dd549c5bedb798a351677 differ diff --git a/test/fixtures/09cfb1f92b3dd549c5bedb798a351677.headers b/test/fixtures/09cfb1f92b3dd549c5bedb798a351677.headers new file mode 100644 index 0000000..d5412ef --- /dev/null +++ b/test/fixtures/09cfb1f92b3dd549c5bedb798a351677.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "653", + "x-ratelimit-reset": "1481687778", + "server": "Plack::Handler::Starlet", + "etag": "W/\"32d2057bf6fa9b346b4121c127424148\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/hcwQmxWsG3GdAQvfBa1SCpp4FuU-?fmt=json", + "time": 578, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831 b/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831 new file mode 100644 index 0000000..cda3631 Binary files /dev/null and b/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831 differ diff --git a/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831.headers b/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831.headers new file mode 100644 index 0000000..6d7aa99 --- /dev/null +++ b/test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:55 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "633", + "x-ratelimit-reset": "1481687756", + "server": "Plack::Handler::Starlet", + "etag": "W/\"8efbe85e770c94f1eafaa164979660c3\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/5JmJmTPkKkYLm2QFsIh1mpjIBsQ-?fmt=json", + "time": 657, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/2f9e4c201203a33929006daf7b750f02 b/test/fixtures/2f9e4c201203a33929006daf7b750f02 new file mode 100644 index 0000000..c05ac1a Binary files /dev/null and b/test/fixtures/2f9e4c201203a33929006daf7b750f02 differ diff --git a/test/fixtures/2f9e4c201203a33929006daf7b750f02.headers b/test/fixtures/2f9e4c201203a33929006daf7b750f02.headers new file mode 100644 index 0000000..d73f4e4 --- /dev/null +++ b/test/fixtures/2f9e4c201203a33929006daf7b750f02.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:50 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "433", + "x-ratelimit-reset": "1481687750", + "server": "Plack::Handler::Starlet", + "etag": "W/\"57593d2c6412c5ed2525116fbe713e6f\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/TMXdzZkTcc9Jq24PD0w5J9_AXms-?fmt=json", + "time": 425, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/42f40bd6ce862b553415369e4aae5c78 b/test/fixtures/42f40bd6ce862b553415369e4aae5c78 new file mode 100644 index 0000000..3c4589e Binary files /dev/null and b/test/fixtures/42f40bd6ce862b553415369e4aae5c78 differ diff --git a/test/fixtures/42f40bd6ce862b553415369e4aae5c78.headers b/test/fixtures/42f40bd6ce862b553415369e4aae5c78.headers new file mode 100644 index 0000000..b71a5f5 --- /dev/null +++ b/test/fixtures/42f40bd6ce862b553415369e4aae5c78.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:06 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "421", + "x-ratelimit-reset": "1481687766", + "server": "Plack::Handler::Starlet", + "etag": "W/\"4d10c2fe9b1985981a2a09cfe63354c7\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/Wk7n0EOphIdSwVG38ICTgVxKH3k-?fmt=json", + "time": 577, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/46531076b098c8c871b33d19c26a8238 b/test/fixtures/46531076b098c8c871b33d19c26a8238 new file mode 100644 index 0000000..c31d8f9 Binary files /dev/null and b/test/fixtures/46531076b098c8c871b33d19c26a8238 differ diff --git a/test/fixtures/46531076b098c8c871b33d19c26a8238.headers b/test/fixtures/46531076b098c8c871b33d19c26a8238.headers new file mode 100644 index 0000000..906c9a0 --- /dev/null +++ b/test/fixtures/46531076b098c8c871b33d19c26a8238.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:06 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "424", + "x-ratelimit-reset": "1481687766", + "server": "Plack::Handler::Starlet", + "etag": "W/\"e2dd87c51ca853754ac123b68d9fb091\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/OlFYu35KMh5W5A8rS2npaC5iOOA-?fmt=json", + "time": 584, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd b/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd new file mode 100644 index 0000000..58bdedf Binary files /dev/null and b/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd differ diff --git a/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd.headers b/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd.headers new file mode 100644 index 0000000..98cb18c --- /dev/null +++ b/test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:11 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "554", + "x-ratelimit-reset": "1481687772", + "server": "Plack::Handler::Starlet", + "etag": "W/\"46ab7ed9acc3d2f5050133ed1c09d5b4\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/ZQApCKC13fLDKtoelWo0nUXSlDI-?fmt=json", + "time": 678, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/4d223095d0a662328e7304f0e22d7cd5 b/test/fixtures/4d223095d0a662328e7304f0e22d7cd5 new file mode 100644 index 0000000..2ce275c Binary files /dev/null and b/test/fixtures/4d223095d0a662328e7304f0e22d7cd5 differ diff --git a/test/fixtures/4d223095d0a662328e7304f0e22d7cd5.headers b/test/fixtures/4d223095d0a662328e7304f0e22d7cd5.headers new file mode 100644 index 0000000..1ade984 --- /dev/null +++ b/test/fixtures/4d223095d0a662328e7304f0e22d7cd5.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:00 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "328", + "x-ratelimit-reset": "1481687760", + "server": "Plack::Handler::Starlet", + "etag": "W/\"baf39b8ec310f75c4879e425278c87ee\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/LJbrPXYlRQOp92.q09PsOJIDp64-?fmt=json", + "time": 565, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca b/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca new file mode 100644 index 0000000..2c287f2 Binary files /dev/null and b/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca differ diff --git a/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca.headers b/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca.headers new file mode 100644 index 0000000..817c5a9 --- /dev/null +++ b/test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:55 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "629", + "x-ratelimit-reset": "1481687756", + "server": "Plack::Handler::Starlet", + "etag": "W/\"8c8694ef7998292fb0e5aee9273bfc9c\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/8jTZJTgjGGtKjwdt8UyAgK3DnbY-?fmt=json", + "time": 667, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/50eed45006ac687345f88f82f940541c b/test/fixtures/50eed45006ac687345f88f82f940541c new file mode 100644 index 0000000..43f0975 Binary files /dev/null and b/test/fixtures/50eed45006ac687345f88f82f940541c differ diff --git a/test/fixtures/50eed45006ac687345f88f82f940541c.headers b/test/fixtures/50eed45006ac687345f88f82f940541c.headers new file mode 100644 index 0000000..ac392c7 --- /dev/null +++ b/test/fixtures/50eed45006ac687345f88f82f940541c.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:11 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "557", + "x-ratelimit-reset": "1481687772", + "server": "Plack::Handler::Starlet", + "etag": "W/\"4a5adcd26ec43e7c51b0f6507bebc96d\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/X4z7DwTJvy7TM.kmgxMsULXhXE4-?fmt=json", + "time": 600, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/5587cbca6ce9cbeb52754f32f8720461 b/test/fixtures/5587cbca6ce9cbeb52754f32f8720461 new file mode 100644 index 0000000..d1bb2f7 Binary files /dev/null and b/test/fixtures/5587cbca6ce9cbeb52754f32f8720461 differ diff --git a/test/fixtures/5587cbca6ce9cbeb52754f32f8720461.headers b/test/fixtures/5587cbca6ce9cbeb52754f32f8720461.headers new file mode 100644 index 0000000..efa0be3 --- /dev/null +++ b/test/fixtures/5587cbca6ce9cbeb52754f32f8720461.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:55 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "623", + "x-ratelimit-reset": "1481687756", + "server": "Plack::Handler::Starlet", + "etag": "W/\"614ec88016c46be66c850f4681039414\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/BTRGIyOdiZ9zJWqrOdTpo5l6RNY-?fmt=json", + "time": 633, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/5eaca7f373d448e50af4f742153d551a b/test/fixtures/5eaca7f373d448e50af4f742153d551a new file mode 100644 index 0000000..c16c2d5 Binary files /dev/null and b/test/fixtures/5eaca7f373d448e50af4f742153d551a differ diff --git a/test/fixtures/5eaca7f373d448e50af4f742153d551a.headers b/test/fixtures/5eaca7f373d448e50af4f742153d551a.headers new file mode 100644 index 0000000..d1f031c --- /dev/null +++ b/test/fixtures/5eaca7f373d448e50af4f742153d551a.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:55 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "628", + "x-ratelimit-reset": "1481687756", + "server": "Plack::Handler::Starlet", + "etag": "W/\"cda0e7ee08880dfac7d510261e1914d0\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/JqKqVx.6RyPF63qiq.UkZKL1amc-?fmt=json", + "time": 657, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9 b/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9 new file mode 100644 index 0000000..6eb9139 Binary files /dev/null and b/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9 differ diff --git a/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9.headers b/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9.headers new file mode 100644 index 0000000..ddc8888 --- /dev/null +++ b/test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "648", + "x-ratelimit-reset": "1481687778", + "server": "Plack::Handler::Starlet", + "etag": "W/\"1e23b4d88952ed276b5a0c139ffb5982\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/iyuUxXxwVb95qzws9gT.0p.NNS0-?fmt=json", + "time": 595, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/7d26defc18d36a78fa294252c2929aba b/test/fixtures/7d26defc18d36a78fa294252c2929aba new file mode 100644 index 0000000..583fa5b Binary files /dev/null and b/test/fixtures/7d26defc18d36a78fa294252c2929aba differ diff --git a/test/fixtures/7d26defc18d36a78fa294252c2929aba.headers b/test/fixtures/7d26defc18d36a78fa294252c2929aba.headers new file mode 100644 index 0000000..29cea3d --- /dev/null +++ b/test/fixtures/7d26defc18d36a78fa294252c2929aba.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:11 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "558", + "x-ratelimit-reset": "1481687772", + "server": "Plack::Handler::Starlet", + "etag": "W/\"dac58f112dc22a1767c7308c353b7ddc\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/YgQIINbxyNhTDK5Iyot3I9irp3c-?fmt=json", + "time": 634, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/84c5658a165655d0beea1840cc65b29e b/test/fixtures/84c5658a165655d0beea1840cc65b29e new file mode 100644 index 0000000..ec3b843 Binary files /dev/null and b/test/fixtures/84c5658a165655d0beea1840cc65b29e differ diff --git a/test/fixtures/84c5658a165655d0beea1840cc65b29e.headers b/test/fixtures/84c5658a165655d0beea1840cc65b29e.headers new file mode 100644 index 0000000..929768f --- /dev/null +++ b/test/fixtures/84c5658a165655d0beea1840cc65b29e.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:00 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "326", + "x-ratelimit-reset": "1481687760", + "server": "Plack::Handler::Starlet", + "etag": "W/\"b4482322628423dfefc67b264b740ed4\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/KfzSur0dV4W.P4zSxxNnF0eUvwQ-?fmt=json", + "time": 623, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb b/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb new file mode 100644 index 0000000..d52d7ad Binary files /dev/null and b/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb differ diff --git a/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb.headers b/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb.headers new file mode 100644 index 0000000..7987efc --- /dev/null +++ b/test/fixtures/87a55fd7ad8a5996efd9fa87a188decb.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:37:16 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "632", + "x-ratelimit-reset": "1481686638", + "server": "Plack::Handler::Starlet", + "etag": "W/\"69c1c2b6e13b63f4ed96767f4db1b2a9\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release/7f6d3088-837d-495e-905f-be5c70ac2d82?inc=media%2Bdiscids&fmt=json", + "time": 522, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/8b531977c80772b52f69fa86983fb719 b/test/fixtures/8b531977c80772b52f69fa86983fb719 new file mode 100644 index 0000000..20334ef Binary files /dev/null and b/test/fixtures/8b531977c80772b52f69fa86983fb719 differ diff --git a/test/fixtures/8b531977c80772b52f69fa86983fb719.headers b/test/fixtures/8b531977c80772b52f69fa86983fb719.headers new file mode 100644 index 0000000..83eaa20 --- /dev/null +++ b/test/fixtures/8b531977c80772b52f69fa86983fb719.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:50 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "333", + "x-ratelimit-reset": "1481687750", + "server": "Plack::Handler::Starlet", + "etag": "W/\"74fcc7a55c8bf1b95b3c890d7ae26868\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/rKs_PWM2y.8B7uVgxqJqzTDz7vs-?fmt=json", + "time": 443, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e b/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e new file mode 100644 index 0000000..e9a489f Binary files /dev/null and b/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e differ diff --git a/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e.headers b/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e.headers new file mode 100644 index 0000000..297d113 --- /dev/null +++ b/test/fixtures/8e96f4f0200526a12901b8b3f596cd5e.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:11 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "551", + "x-ratelimit-reset": "1481687772", + "server": "Plack::Handler::Starlet", + "etag": "W/\"784303af8cc0139a7dfb83ab641f799e\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/dT0qfu73Iao5WeycmQB3MOWJ3F8-?fmt=json", + "time": 625, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/942f9d096b7e5f2a79cf945af616c347 b/test/fixtures/942f9d096b7e5f2a79cf945af616c347 new file mode 100644 index 0000000..dfea318 Binary files /dev/null and b/test/fixtures/942f9d096b7e5f2a79cf945af616c347 differ diff --git a/test/fixtures/942f9d096b7e5f2a79cf945af616c347.headers b/test/fixtures/942f9d096b7e5f2a79cf945af616c347.headers new file mode 100644 index 0000000..75f7b33 --- /dev/null +++ b/test/fixtures/942f9d096b7e5f2a79cf945af616c347.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:05:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "431", + "x-ratelimit-reset": "1481684718", + "server": "Plack::Handler::Starlet", + "etag": "W/\"377590d5c3592441ed13c98359ec88ba\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release/a4864e94-6d75-4ade-bc93-0dabf3521453?inc=media%2Bdiscids&fmt=json", + "time": 405, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/9fe6edd3110d84cfd764cab7344c3061 b/test/fixtures/9fe6edd3110d84cfd764cab7344c3061 new file mode 100644 index 0000000..76c7248 Binary files /dev/null and b/test/fixtures/9fe6edd3110d84cfd764cab7344c3061 differ diff --git a/test/fixtures/9fe6edd3110d84cfd764cab7344c3061.headers b/test/fixtures/9fe6edd3110d84cfd764cab7344c3061.headers new file mode 100644 index 0000000..7f0e550 --- /dev/null +++ b/test/fixtures/9fe6edd3110d84cfd764cab7344c3061.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:06 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "422", + "x-ratelimit-reset": "1481687766", + "server": "Plack::Handler::Starlet", + "etag": "W/\"99f9bf6fb616eef573908b2cdee82ade\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/OpEqBUFSMylTQ_KyaQMw0CFjeBQ-?fmt=json", + "time": 589, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/a97a8246ca686a803bc85880341f01f7 b/test/fixtures/a97a8246ca686a803bc85880341f01f7 new file mode 100644 index 0000000..e04614e Binary files /dev/null and b/test/fixtures/a97a8246ca686a803bc85880341f01f7 differ diff --git a/test/fixtures/a97a8246ca686a803bc85880341f01f7.headers b/test/fixtures/a97a8246ca686a803bc85880341f01f7.headers new file mode 100644 index 0000000..d540920 --- /dev/null +++ b/test/fixtures/a97a8246ca686a803bc85880341f01f7.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:55 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "630", + "x-ratelimit-reset": "1481687756", + "server": "Plack::Handler::Starlet", + "etag": "W/\"eccd78e3af3df2654ec5989d8fca8a72\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/6S.Rie5e4noRyrN6Jf.styseKak-?fmt=json", + "time": 596, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/ad145d4c621f3570ce7f13ae70291eec b/test/fixtures/ad145d4c621f3570ce7f13ae70291eec new file mode 100644 index 0000000..f381599 Binary files /dev/null and b/test/fixtures/ad145d4c621f3570ce7f13ae70291eec differ diff --git a/test/fixtures/ad145d4c621f3570ce7f13ae70291eec.headers b/test/fixtures/ad145d4c621f3570ce7f13ae70291eec.headers new file mode 100644 index 0000000..f5daf76 --- /dev/null +++ b/test/fixtures/ad145d4c621f3570ce7f13ae70291eec.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:11 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "553", + "x-ratelimit-reset": "1481687772", + "server": "Plack::Handler::Starlet", + "etag": "W/\"6bf1abc5131d83247f11aba2cea66e92\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/ZpxxNqBzOe1KJQUSJotRAdo1FAA-?fmt=json", + "time": 622, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f b/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f new file mode 100644 index 0000000..bce15c6 Binary files /dev/null and b/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f differ diff --git a/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f.headers b/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f.headers new file mode 100644 index 0000000..ad7539e --- /dev/null +++ b/test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:00 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "317", + "x-ratelimit-reset": "1481687760", + "server": "Plack::Handler::Starlet", + "etag": "W/\"a74c03111a54b918359bdeb053ddbaf2\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/MRmVoUlZOvKGZFxixVTsalKWr1Y-?fmt=json", + "time": 605, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/afe809da6a1182c06e0b3a6016806801 b/test/fixtures/afe809da6a1182c06e0b3a6016806801 new file mode 100644 index 0000000..5459a97 Binary files /dev/null and b/test/fixtures/afe809da6a1182c06e0b3a6016806801 differ diff --git a/test/fixtures/afe809da6a1182c06e0b3a6016806801.headers b/test/fixtures/afe809da6a1182c06e0b3a6016806801.headers new file mode 100644 index 0000000..4544ca0 --- /dev/null +++ b/test/fixtures/afe809da6a1182c06e0b3a6016806801.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:06 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "427", + "x-ratelimit-reset": "1481687766", + "server": "Plack::Handler::Starlet", + "etag": "W/\"b96f6e53db8de36a9636aaf43ec81d81\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/Nxl.5VZyyw0PwNZmfKOjUo.hNHQ-?fmt=json", + "time": 568, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/b31e543dce9796e06556a651cc9856c2 b/test/fixtures/b31e543dce9796e06556a651cc9856c2 new file mode 100644 index 0000000..a0be04d Binary files /dev/null and b/test/fixtures/b31e543dce9796e06556a651cc9856c2 differ diff --git a/test/fixtures/b31e543dce9796e06556a651cc9856c2.headers b/test/fixtures/b31e543dce9796e06556a651cc9856c2.headers new file mode 100644 index 0000000..e274dd3 --- /dev/null +++ b/test/fixtures/b31e543dce9796e06556a651cc9856c2.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:06 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "425", + "x-ratelimit-reset": "1481687766", + "server": "Plack::Handler::Starlet", + "etag": "W/\"8f6f3f31f4a37066b07ac26d78ea1fa4\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/MvkF2QCiXS.tu7kJYnDfAX2A6II-?fmt=json", + "time": 580, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/b867d371abb4b963b6f68cbfc103f644 b/test/fixtures/b867d371abb4b963b6f68cbfc103f644 new file mode 100644 index 0000000..d63ff3c Binary files /dev/null and b/test/fixtures/b867d371abb4b963b6f68cbfc103f644 differ diff --git a/test/fixtures/b867d371abb4b963b6f68cbfc103f644.headers b/test/fixtures/b867d371abb4b963b6f68cbfc103f644.headers new file mode 100644 index 0000000..b9eab7f --- /dev/null +++ b/test/fixtures/b867d371abb4b963b6f68cbfc103f644.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:00 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "319", + "x-ratelimit-reset": "1481687760", + "server": "Plack::Handler::Starlet", + "etag": "W/\"4e8503a236dbcbe9d5583f5a684fb8ec\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/M5ef947_b48iguGQaG.URuoqfXE-?fmt=json", + "time": 616, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec b/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec new file mode 100644 index 0000000..96833f4 Binary files /dev/null and b/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec differ diff --git a/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec.headers b/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec.headers new file mode 100644 index 0000000..3a75b69 --- /dev/null +++ b/test/fixtures/c5e74502a62b5e330f0e44f9daece6ec.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "645", + "x-ratelimit-reset": "1481687778", + "server": "Plack::Handler::Starlet", + "etag": "W/\"2e7a8dbce2d08bb993c31df65d154fb2\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/mWEN0CB96pflhED60JyFNhrEvMc-?fmt=json", + "time": 598, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/cd5ea3df3b6164f9b021690a01da1424 b/test/fixtures/cd5ea3df3b6164f9b021690a01da1424 new file mode 100644 index 0000000..710635c Binary files /dev/null and b/test/fixtures/cd5ea3df3b6164f9b021690a01da1424 differ diff --git a/test/fixtures/cd5ea3df3b6164f9b021690a01da1424.headers b/test/fixtures/cd5ea3df3b6164f9b021690a01da1424.headers new file mode 100644 index 0000000..f8e7970 --- /dev/null +++ b/test/fixtures/cd5ea3df3b6164f9b021690a01da1424.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "642", + "x-ratelimit-reset": "1481687778", + "server": "Plack::Handler::Starlet", + "etag": "W/\"31e7cc9a9174e173c88d4618b238f8ac\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/jmIgyOvnkIgc_1nIfGOzq1tZy.g-?fmt=json", + "time": 598, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/cdfa24feec8a751a9257cba4c542ca08 b/test/fixtures/cdfa24feec8a751a9257cba4c542ca08 new file mode 100644 index 0000000..5530c18 Binary files /dev/null and b/test/fixtures/cdfa24feec8a751a9257cba4c542ca08 differ diff --git a/test/fixtures/cdfa24feec8a751a9257cba4c542ca08.headers b/test/fixtures/cdfa24feec8a751a9257cba4c542ca08.headers new file mode 100644 index 0000000..d0b6ce0 --- /dev/null +++ b/test/fixtures/cdfa24feec8a751a9257cba4c542ca08.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:55:50 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "331", + "x-ratelimit-reset": "1481687750", + "server": "Plack::Handler::Starlet", + "etag": "W/\"b47b135de1ba186aaacb5cf1899a3cfc\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/ZODzHFPuY6DfakUIAd7bTSne224-?fmt=json", + "time": 418, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2 b/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2 new file mode 100644 index 0000000..f9033ab Binary files /dev/null and b/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2 differ diff --git a/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2.headers b/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2.headers new file mode 100644 index 0000000..6c7bf07 --- /dev/null +++ b/test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:22 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "306", + "x-ratelimit-reset": "1481687782", + "server": "Plack::Handler::Starlet", + "etag": "W/\"94a1d89e4094492980cc3c59a43bfaa7\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/vnTnHXtoa0q35uGdb80jCbMY0fI-?fmt=json", + "time": 616, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/dce546fb301927f48b5a344af5157931 b/test/fixtures/dce546fb301927f48b5a344af5157931 new file mode 100644 index 0000000..584891c Binary files /dev/null and b/test/fixtures/dce546fb301927f48b5a344af5157931 differ diff --git a/test/fixtures/dce546fb301927f48b5a344af5157931.headers b/test/fixtures/dce546fb301927f48b5a344af5157931.headers new file mode 100644 index 0000000..8656fc7 --- /dev/null +++ b/test/fixtures/dce546fb301927f48b5a344af5157931.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:00 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "320", + "x-ratelimit-reset": "1481687760", + "server": "Plack::Handler::Starlet", + "etag": "W/\"18ffe91f797d0ac3f7bb5f55afe8af9e\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/Ljf3f57fCuw7rpaaa5eXOQz.7iQ-?fmt=json", + "time": 612, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/e2e06e403837e86ba8a0f80693d2e189 b/test/fixtures/e2e06e403837e86ba8a0f80693d2e189 new file mode 100644 index 0000000..d578fbd Binary files /dev/null and b/test/fixtures/e2e06e403837e86ba8a0f80693d2e189 differ diff --git a/test/fixtures/e2e06e403837e86ba8a0f80693d2e189.headers b/test/fixtures/e2e06e403837e86ba8a0f80693d2e189.headers new file mode 100644 index 0000000..d7f51c4 --- /dev/null +++ b/test/fixtures/e2e06e403837e86ba8a0f80693d2e189.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:17 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "651", + "x-ratelimit-reset": "1481687778", + "server": "Plack::Handler::Starlet", + "etag": "W/\"ed7b1e67a098c033f07a041ffa76a998\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/eRs4VG66pPW2MqTunBs9dEZTm9A-?fmt=json", + "time": 564, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774 b/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774 new file mode 100644 index 0000000..281dbd1 Binary files /dev/null and b/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774 differ diff --git a/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774.headers b/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774.headers new file mode 100644 index 0000000..bd69879 --- /dev/null +++ b/test/fixtures/fd7b5af8b59c7fe254b576ea6c206774.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Wed, 14 Dec 2016 03:56:22 GMT", + "content-type": "application/json; charset=utf-8", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "keep-alive": "timeout=15", + "vary": "Accept-Encoding", + "x-ratelimit-limit": "700", + "x-ratelimit-remaining": "304", + "x-ratelimit-reset": "1481687782", + "server": "Plack::Handler::Starlet", + "etag": "W/\"87d86129dfb94d7fb7710f38e30c4605\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/discid/tH_cY6hcuSDeTuG6GSWI4wp_x6E-?fmt=json", + "time": 619, + "request": { + "method": "GET", + "headers": { + "User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )", + "host": "musicbrainz.org", + "accept-encoding": "gzip, deflate", + "accept": "application/json" + } + } +} \ No newline at end of file diff --git a/test/schema.js b/test/schema.js index 16e1452..33f9f20 100644 --- a/test/schema.js +++ b/test/schema.js @@ -907,3 +907,127 @@ test('some entities support ratings', testData, ` t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.voteCount > 0)) t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.value > 3)) }) + +test('discs can be looked up by disc ID', testData, ` + { + lookup { + disc(discID: "TMXdzZkTcc9Jq24PD0w5J9_AXms-") { + id + discID + offsetCount + offsets + sectors + releases { + totalCount + edges { + node { + mbid + } + } + } + } + } + } +`, (t, data) => { + const { disc } = data.lookup + t.is(disc.discID, 'TMXdzZkTcc9Jq24PD0w5J9_AXms-') + t.is(disc.offsetCount, 9) + t.is(disc.sectors, 193443) + t.deepEqual(disc.offsets, [ + 150, 18190, 34163, 66150, 87453, 116853, 151413, 166833, 184123 + ]) + t.is(disc.releases.totalCount, 1) + t.is(disc.releases.edges.length, 1) + t.is(disc.releases.edges[0].node.mbid, '7f6d3088-837d-495e-905f-be5c70ac2d82') +}) + +test('release media has a list of discs', testData, ` + { + lookup { + release(mbid: "7f6d3088-837d-495e-905f-be5c70ac2d82") { + media { + discs { + discID + releases { + totalCount + edges { + node { + mbid + } + } + } + } + } + } + } + } +`, (t, data) => { + const { release } = data.lookup + t.is(release.media.length, 1) + t.is(release.media[0].discs.length, 2) +}) + +test('disc queries can be deeply nested', testData, ` + { + lookup { + disc(discID: "TMXdzZkTcc9Jq24PD0w5J9_AXms-") { + discID + offsetCount + offsets + sectors + releases { + totalCount + edges { + node { + mbid + title + date + media { + discs { + discID + releases { + edges { + node { + date + media { + discs { + discID + releases { + edges { + node { + date + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +`, (t, data) => { + const { disc } = data.lookup + t.true(disc.releases.edges.length > 0) + disc.releases.edges.forEach(release => { + t.true(release.node.media.length > 0) + release.node.media.forEach(medium => { + t.true(medium.discs.length > 0) + medium.discs.forEach(disc => { + t.true(disc.releases.edges.length > 0) + disc.releases.edges.forEach(release => { + t.true(release.node.media.length > 0) + release.node.media.forEach(medium => { + t.true(medium.discs.length > 0) + }) + }) + }) + }) + }) +})