From 7d45b44cda56e4844fac2a8cc80a0f7e0518e92c Mon Sep 17 00:00:00 2001 From: Brian Beck Date: Tue, 13 Dec 2016 20:50:38 -0800 Subject: [PATCH] Add ratings (#15) --- docs/schema.md | 52 +++++-- docs/types.md | 95 +++++++++++-- schema.json | 133 ++++++++++++++++-- src/resolvers.js | 1 + src/types/artist.js | 2 + src/types/event.js | 2 + src/types/helpers.js | 7 + src/types/label.js | 2 + src/types/rating.js | 24 ++++ src/types/recording.js | 2 + src/types/release-group.js | 2 + src/types/work.js | 2 + .../fixtures/029295853b01dffc8f5061e3ab19a1f5 | Bin 0 -> 279 bytes .../029295853b01dffc8f5061e3ab19a1f5.headers | 29 ++++ .../fixtures/053f4fa909ff28b9a7977ea4c79d3455 | Bin 0 -> 322 bytes .../053f4fa909ff28b9a7977ea4c79d3455.headers | 29 ++++ .../fixtures/113db52529ee59875c0e8938b8176ac9 | Bin 0 -> 217 bytes .../113db52529ee59875c0e8938b8176ac9.headers | 29 ++++ .../fixtures/14d10341ea355048f1c3b6bd9a398842 | Bin 0 -> 208 bytes .../14d10341ea355048f1c3b6bd9a398842.headers | 29 ++++ .../fixtures/1bdc0182f4c05cf480eb9c05af4b976a | Bin 0 -> 310 bytes .../1bdc0182f4c05cf480eb9c05af4b976a.headers | 29 ++++ .../fixtures/2003d2a9c13b2ec4afe52c7de9146d7b | Bin 0 -> 247 bytes .../2003d2a9c13b2ec4afe52c7de9146d7b.headers | 29 ++++ .../fixtures/2411747e0c5d0669d100ab1d280e10d4 | Bin 0 -> 316 bytes .../2411747e0c5d0669d100ab1d280e10d4.headers | 29 ++++ .../fixtures/310dd8dea7247669130cde2559bae02f | Bin 0 -> 273 bytes .../310dd8dea7247669130cde2559bae02f.headers | 29 ++++ .../fixtures/3bd3d3302c90a0bc9ed720a831ff3304 | Bin 0 -> 316 bytes .../3bd3d3302c90a0bc9ed720a831ff3304.headers | 29 ++++ .../fixtures/3d374d64c41545bf2538e8c89472ed9d | Bin 0 -> 317 bytes .../3d374d64c41545bf2538e8c89472ed9d.headers | 29 ++++ .../fixtures/43296de566b64880545e57a0fadb7712 | Bin 0 -> 496 bytes .../43296de566b64880545e57a0fadb7712.headers | 29 ++++ .../fixtures/45daa19eb100ee93bf814b6b7c76d81e | Bin 0 -> 312 bytes .../45daa19eb100ee93bf814b6b7c76d81e.headers | 29 ++++ .../fixtures/4e1f01ba60b51a0696cc97178a29068a | Bin 0 -> 231 bytes .../4e1f01ba60b51a0696cc97178a29068a.headers | 29 ++++ .../fixtures/6bef22d668064a78bf636a32f4b4a536 | Bin 0 -> 321 bytes .../6bef22d668064a78bf636a32f4b4a536.headers | 29 ++++ .../fixtures/6d67e76967cd5d93d61d515f2e6bb203 | Bin 0 -> 210 bytes .../6d67e76967cd5d93d61d515f2e6bb203.headers | 29 ++++ .../fixtures/7ecaf522c01ab6ec413eebc9f2e16a42 | Bin 0 -> 404 bytes .../7ecaf522c01ab6ec413eebc9f2e16a42.headers | 29 ++++ .../fixtures/8b1602fb8d6a9d91230c48f5152a25ca | Bin 0 -> 301 bytes .../8b1602fb8d6a9d91230c48f5152a25ca.headers | 29 ++++ .../fixtures/97957d6dbc8b2d81b65d1b57c0c20810 | Bin 0 -> 265 bytes .../97957d6dbc8b2d81b65d1b57c0c20810.headers | 29 ++++ .../fixtures/99528bcc7f6586bde435b2b8d64b241a | Bin 0 -> 209 bytes .../99528bcc7f6586bde435b2b8d64b241a.headers | 29 ++++ .../fixtures/9cd666caa3723edc6f5438fed0898f86 | Bin 0 -> 863 bytes .../9cd666caa3723edc6f5438fed0898f86.headers | 29 ++++ .../fixtures/9f53b77c31b1a112ff1f5725b912cf69 | Bin 0 -> 208 bytes .../9f53b77c31b1a112ff1f5725b912cf69.headers | 29 ++++ .../fixtures/a310e26b9e92f2a0bab61d4d42912714 | Bin 0 -> 700 bytes .../a310e26b9e92f2a0bab61d4d42912714.headers | 29 ++++ .../fixtures/ab0e9518dfae4758d6cf8280b4eb0dd1 | Bin 0 -> 284 bytes .../ab0e9518dfae4758d6cf8280b4eb0dd1.headers | 29 ++++ .../fixtures/b30ba256126ec9d876b63af6d41040f7 | Bin 0 -> 353 bytes .../b30ba256126ec9d876b63af6d41040f7.headers | 29 ++++ .../fixtures/b781a2b3466da5a546a4ba978df0dce6 | 1 + .../b781a2b3466da5a546a4ba978df0dce6.headers | 27 ++++ .../fixtures/b9875f70a8e288e37b773cc13d32ec30 | Bin 0 -> 366 bytes .../b9875f70a8e288e37b773cc13d32ec30.headers | 29 ++++ .../fixtures/bfd061a64b7aa63058ee3c14ddac6e6b | Bin 0 -> 248 bytes .../bfd061a64b7aa63058ee3c14ddac6e6b.headers | 29 ++++ .../fixtures/c7d3ce37fac463c8977f395759e7a8e8 | Bin 0 -> 214 bytes .../c7d3ce37fac463c8977f395759e7a8e8.headers | 29 ++++ .../fixtures/c8682c07b872491317ff6129e993354b | Bin 0 -> 2431 bytes .../c8682c07b872491317ff6129e993354b.headers | 29 ++++ .../fixtures/d748efa553f827a4594baf0f3cd2bd0e | Bin 0 -> 213 bytes .../d748efa553f827a4594baf0f3cd2bd0e.headers | 29 ++++ .../fixtures/dccbe1460fc101f36eea06bbb408df95 | Bin 0 -> 310 bytes .../dccbe1460fc101f36eea06bbb408df95.headers | 29 ++++ .../fixtures/df91c1a5ada46ccb958bf4837b5e780e | Bin 0 -> 310 bytes .../df91c1a5ada46ccb958bf4837b5e780e.headers | 29 ++++ .../fixtures/e31ec81b50d41606cac51117ade069e5 | Bin 0 -> 314 bytes .../e31ec81b50d41606cac51117ade069e5.headers | 29 ++++ .../fixtures/e68093f6dd838e18194ecc59cddf668c | Bin 0 -> 319 bytes .../e68093f6dd838e18194ecc59cddf668c.headers | 29 ++++ .../fixtures/fed3b13d36aab825c79fb4c130a10ca2 | Bin 0 -> 330 bytes .../fed3b13d36aab825c79fb4c130a10ca2.headers | 29 ++++ test/schema.js | 81 +++++++++++ 83 files changed, 1386 insertions(+), 33 deletions(-) create mode 100644 src/types/rating.js create mode 100644 test/fixtures/029295853b01dffc8f5061e3ab19a1f5 create mode 100644 test/fixtures/029295853b01dffc8f5061e3ab19a1f5.headers create mode 100644 test/fixtures/053f4fa909ff28b9a7977ea4c79d3455 create mode 100644 test/fixtures/053f4fa909ff28b9a7977ea4c79d3455.headers create mode 100644 test/fixtures/113db52529ee59875c0e8938b8176ac9 create mode 100644 test/fixtures/113db52529ee59875c0e8938b8176ac9.headers create mode 100644 test/fixtures/14d10341ea355048f1c3b6bd9a398842 create mode 100644 test/fixtures/14d10341ea355048f1c3b6bd9a398842.headers create mode 100644 test/fixtures/1bdc0182f4c05cf480eb9c05af4b976a create mode 100644 test/fixtures/1bdc0182f4c05cf480eb9c05af4b976a.headers create mode 100644 test/fixtures/2003d2a9c13b2ec4afe52c7de9146d7b create mode 100644 test/fixtures/2003d2a9c13b2ec4afe52c7de9146d7b.headers create mode 100644 test/fixtures/2411747e0c5d0669d100ab1d280e10d4 create mode 100644 test/fixtures/2411747e0c5d0669d100ab1d280e10d4.headers create mode 100644 test/fixtures/310dd8dea7247669130cde2559bae02f create mode 100644 test/fixtures/310dd8dea7247669130cde2559bae02f.headers create mode 100644 test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304 create mode 100644 test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304.headers create mode 100644 test/fixtures/3d374d64c41545bf2538e8c89472ed9d create mode 100644 test/fixtures/3d374d64c41545bf2538e8c89472ed9d.headers create mode 100644 test/fixtures/43296de566b64880545e57a0fadb7712 create mode 100644 test/fixtures/43296de566b64880545e57a0fadb7712.headers create mode 100644 test/fixtures/45daa19eb100ee93bf814b6b7c76d81e create mode 100644 test/fixtures/45daa19eb100ee93bf814b6b7c76d81e.headers create mode 100644 test/fixtures/4e1f01ba60b51a0696cc97178a29068a create mode 100644 test/fixtures/4e1f01ba60b51a0696cc97178a29068a.headers create mode 100644 test/fixtures/6bef22d668064a78bf636a32f4b4a536 create mode 100644 test/fixtures/6bef22d668064a78bf636a32f4b4a536.headers create mode 100644 test/fixtures/6d67e76967cd5d93d61d515f2e6bb203 create mode 100644 test/fixtures/6d67e76967cd5d93d61d515f2e6bb203.headers create mode 100644 test/fixtures/7ecaf522c01ab6ec413eebc9f2e16a42 create mode 100644 test/fixtures/7ecaf522c01ab6ec413eebc9f2e16a42.headers create mode 100644 test/fixtures/8b1602fb8d6a9d91230c48f5152a25ca create mode 100644 test/fixtures/8b1602fb8d6a9d91230c48f5152a25ca.headers create mode 100644 test/fixtures/97957d6dbc8b2d81b65d1b57c0c20810 create mode 100644 test/fixtures/97957d6dbc8b2d81b65d1b57c0c20810.headers create mode 100644 test/fixtures/99528bcc7f6586bde435b2b8d64b241a create mode 100644 test/fixtures/99528bcc7f6586bde435b2b8d64b241a.headers create mode 100644 test/fixtures/9cd666caa3723edc6f5438fed0898f86 create mode 100644 test/fixtures/9cd666caa3723edc6f5438fed0898f86.headers create mode 100644 test/fixtures/9f53b77c31b1a112ff1f5725b912cf69 create mode 100644 test/fixtures/9f53b77c31b1a112ff1f5725b912cf69.headers create mode 100644 test/fixtures/a310e26b9e92f2a0bab61d4d42912714 create mode 100644 test/fixtures/a310e26b9e92f2a0bab61d4d42912714.headers create mode 100644 test/fixtures/ab0e9518dfae4758d6cf8280b4eb0dd1 create mode 100644 test/fixtures/ab0e9518dfae4758d6cf8280b4eb0dd1.headers create mode 100644 test/fixtures/b30ba256126ec9d876b63af6d41040f7 create mode 100644 test/fixtures/b30ba256126ec9d876b63af6d41040f7.headers create mode 100644 test/fixtures/b781a2b3466da5a546a4ba978df0dce6 create mode 100644 test/fixtures/b781a2b3466da5a546a4ba978df0dce6.headers create mode 100644 test/fixtures/b9875f70a8e288e37b773cc13d32ec30 create mode 100644 test/fixtures/b9875f70a8e288e37b773cc13d32ec30.headers create mode 100644 test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b create mode 100644 test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b.headers create mode 100644 test/fixtures/c7d3ce37fac463c8977f395759e7a8e8 create mode 100644 test/fixtures/c7d3ce37fac463c8977f395759e7a8e8.headers create mode 100644 test/fixtures/c8682c07b872491317ff6129e993354b create mode 100644 test/fixtures/c8682c07b872491317ff6129e993354b.headers create mode 100644 test/fixtures/d748efa553f827a4594baf0f3cd2bd0e create mode 100644 test/fixtures/d748efa553f827a4594baf0f3cd2bd0e.headers create mode 100644 test/fixtures/dccbe1460fc101f36eea06bbb408df95 create mode 100644 test/fixtures/dccbe1460fc101f36eea06bbb408df95.headers create mode 100644 test/fixtures/df91c1a5ada46ccb958bf4837b5e780e create mode 100644 test/fixtures/df91c1a5ada46ccb958bf4837b5e780e.headers create mode 100644 test/fixtures/e31ec81b50d41606cac51117ade069e5 create mode 100644 test/fixtures/e31ec81b50d41606cac51117ade069e5.headers create mode 100644 test/fixtures/e68093f6dd838e18194ecc59cddf668c create mode 100644 test/fixtures/e68093f6dd838e18194ecc59cddf668c.headers create mode 100644 test/fixtures/fed3b13d36aab825c79fb4c130a10ca2 create mode 100644 test/fixtures/fed3b13d36aab825c79fb4c130a10ca2.headers diff --git a/docs/schema.md b/docs/schema.md index 1f4711c..53c499f 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -84,7 +84,7 @@ type Area implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection # A list of tags linked to this entity. @@ -215,9 +215,12 @@ type Artist implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } @@ -656,9 +659,12 @@ type Event implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } @@ -725,7 +731,7 @@ type Instrument implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection # A list of tags linked to this entity. @@ -850,9 +856,12 @@ type Label implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } @@ -1081,7 +1090,7 @@ type Place implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection # A list of tags linked to this entity. @@ -1133,6 +1142,18 @@ type Query { ): Node } +# [Ratings](https://musicbrainz.org/doc/Rating_System) allow users +# to rate MusicBrainz entities. User may assign a value between 1 and 5; these +# values are then aggregated by the server to compute an average community rating +# for the entity. +type Rating { + # The number of votes that have contributed to the rating. + voteCount: Int! + + # The average rating value based on the aggregated votes. + value: Int +} + # A [recording](https://musicbrainz.org/doc/Recording) is an # entity in MusicBrainz which can be linked to tracks on releases. Each track must # always be associated with a single recording, but a recording can be linked to @@ -1196,9 +1217,12 @@ type Recording implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } @@ -1599,7 +1623,7 @@ type Release implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection # A list of tags linked to this entity. @@ -1708,9 +1732,12 @@ type ReleaseGroup implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } @@ -1974,7 +2001,7 @@ type Series implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection # A list of tags linked to this entity. @@ -2107,9 +2134,12 @@ type Work implements Node, Entity { # Relationships between this entity and other entitites. relationships: Relationships - # A list of collections linked to this entity. + # A list of collections containing this entity. collections(after: String, first: Int): CollectionConnection + # The rating users have given to this entity. + rating: Rating + # A list of tags linked to this entity. tags(after: String, first: Int): TagConnection } diff --git a/docs/types.md b/docs/types.md index eef0911..f016348 100644 --- a/docs/types.md +++ b/docs/types.md @@ -34,6 +34,7 @@ You may also be interested in reading the [schema in GraphQL syntax](schema.md).
  • [Place](#place)
  • [PlaceConnection](#placeconnection)
  • [PlaceEdge](#placeedge)
  • +
  • [Rating](#rating)
  • [Recording](#recording)
  • [RecordingConnection](#recordingconnection)
  • [RecordingEdge](#recordingedge)
  • @@ -371,7 +372,7 @@ the codes assigned by ISO to countries and subdivisions. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -714,7 +715,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -727,6 +728,13 @@ field. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection @@ -1754,7 +1762,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -1767,6 +1775,13 @@ field. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection @@ -1941,7 +1956,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -2193,7 +2208,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -2206,6 +2221,13 @@ field. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection @@ -2723,7 +2745,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -2825,6 +2847,36 @@ these results were found through a search. +### Rating + +[Ratings](https://musicbrainz.org/doc/Rating_System) allow users +to rate MusicBrainz entities. User may assign a value between 1 and 5; these +values are then aggregated by the server to compute an average community rating +for the entity. + + + + + + + + + + + + + + + + + + +
    Field / ArgumentTypeDescription
    voteCount Int! + The number of votes that have contributed to the rating. +
    value Int + The average rating value based on the aggregated votes. +
    + ### Recording A [recording](https://musicbrainz.org/doc/Recording) is an @@ -2981,7 +3033,7 @@ from the lengths of the tracks using it. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -2994,6 +3046,13 @@ from the lengths of the tracks using it. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection @@ -4024,7 +4083,7 @@ It is not a mark of how good or bad the music itself is – for that, use collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -4324,7 +4383,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -4337,6 +4396,13 @@ field. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection @@ -4760,7 +4826,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -5111,7 +5177,7 @@ field. collections CollectionConnection - A list of collections linked to this entity. + A list of collections containing this entity. @@ -5124,6 +5190,13 @@ field. Int + + rating + Rating + + The rating users have given to this entity. + + tags TagConnection diff --git a/schema.json b/schema.json index e75dcd0..ce19f01 100644 --- a/schema.json +++ b/schema.json @@ -771,7 +771,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -1761,7 +1761,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -1792,6 +1792,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", @@ -2282,7 +2294,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -2313,6 +2325,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", @@ -3087,7 +3111,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -3642,7 +3666,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -3673,6 +3697,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", @@ -6003,7 +6039,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -6034,6 +6070,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", @@ -6094,6 +6142,45 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "Rating", + "description": "[Ratings](https://musicbrainz.org/doc/Rating_System) allow users\nto rate MusicBrainz entities. User may assign a value between 1 and 5; these\nvalues are then aggregated by the server to compute an average community rating\nfor the entity.", + "fields": [ + { + "name": "voteCount", + "description": "The number of votes that have contributed to the rating.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The average rating value based on the aggregated votes.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "TagConnection", @@ -6472,7 +6559,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -6855,7 +6942,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -7372,7 +7459,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -7403,6 +7490,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", @@ -7658,7 +7757,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -8021,7 +8120,7 @@ }, { "name": "collections", - "description": "A list of collections linked to this entity.", + "description": "A list of collections containing this entity.", "args": [ { "name": "after", @@ -8052,6 +8151,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "rating", + "description": "The rating users have given to this entity.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Rating", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "tags", "description": "A list of tags linked to this entity.", diff --git a/src/resolvers.js b/src/resolvers.js index 1b8ddbb..8f8b80c 100644 --- a/src/resolvers.js +++ b/src/resolvers.js @@ -43,6 +43,7 @@ export function includeSubqueries (params, info, fragments = info.fragments) { artistCredits: 'artist-credits', isrcs: 'isrcs', media: 'media', + rating: 'ratings', tags: 'tags' } let fields = getFields(info, fragments) diff --git a/src/types/artist.js b/src/types/artist.js index d2d1357..a1dc256 100644 --- a/src/types/artist.js +++ b/src/types/artist.js @@ -19,6 +19,7 @@ import { works, relationships, collections, + rating, tags, connectionWithExtras } from './helpers' @@ -84,6 +85,7 @@ neither. Groups do not have genders.` works, relationships, collections, + rating, tags }) }) diff --git a/src/types/event.js b/src/types/event.js index 95a206e..d4b603d 100644 --- a/src/types/event.js +++ b/src/types/event.js @@ -12,6 +12,7 @@ import { lifeSpan, relationships, collections, + rating, tags, connectionWithExtras } from './helpers' @@ -48,6 +49,7 @@ for syntax and examples.` }), relationships, collections, + rating, tags }) }) diff --git a/src/types/helpers.js b/src/types/helpers.js index a0e81d2..32c497d 100644 --- a/src/types/helpers.js +++ b/src/types/helpers.js @@ -26,6 +26,7 @@ import { InstrumentConnection } from './instrument' import { LabelConnection } from './label' import LifeSpan from './life-span' import { PlaceConnection } from './place' +import Rating from './rating' import { RecordingConnection } from './recording' import { RelationshipConnection } from './relationship' import { ReleaseConnection } from './release' @@ -215,6 +216,12 @@ and will be removed in a major release in the future. Use the equivalent \`artistCredits\` field.` } +export const rating = { + type: Rating, + description: 'The rating users have given to this entity.', + resolve: createSubqueryResolver({ inc: 'ratings' }) +} + export const releaseGroupType = { type: new GraphQLList(ReleaseGroupType), description: 'Filter by one or more release group types.' diff --git a/src/types/label.js b/src/types/label.js index 465158f..760fe5d 100644 --- a/src/types/label.js +++ b/src/types/label.js @@ -20,6 +20,7 @@ import { relationships, collections, tags, + rating, fieldWithID, connectionWithExtras } from './helpers' @@ -63,6 +64,7 @@ imprint, production, distributor, rights society, etc.` releases, relationships, collections, + rating, tags }) }) diff --git a/src/types/rating.js b/src/types/rating.js new file mode 100644 index 0000000..6047302 --- /dev/null +++ b/src/types/rating.js @@ -0,0 +1,24 @@ +import { + GraphQLObjectType, + GraphQLNonNull, + GraphQLInt +} from 'graphql/type' + +export default new GraphQLObjectType({ + name: 'Rating', + description: `[Ratings](https://musicbrainz.org/doc/Rating_System) allow users +to rate MusicBrainz entities. User may assign a value between 1 and 5; these +values are then aggregated by the server to compute an average community rating +for the entity.`, + fields: () => ({ + voteCount: { + type: new GraphQLNonNull(GraphQLInt), + description: 'The number of votes that have contributed to the rating.', + resolve: rating => rating['votes-count'] + }, + value: { + type: GraphQLInt, + description: 'The average rating value based on the aggregated votes.' + } + }) +}) diff --git a/src/types/recording.js b/src/types/recording.js index a8c2e30..cf950ca 100644 --- a/src/types/recording.js +++ b/src/types/recording.js @@ -18,6 +18,7 @@ import { releases, relationships, collections, + rating, tags, connectionWithExtras } from './helpers' @@ -63,6 +64,7 @@ from the lengths of the tracks using it.` releases, relationships, collections, + rating, tags }) }) diff --git a/src/types/release-group.js b/src/types/release-group.js index 4e100e7..6161202 100644 --- a/src/types/release-group.js +++ b/src/types/release-group.js @@ -15,6 +15,7 @@ import { releases, relationships, collections, + rating, tags, fieldWithID, resolveHyphenated, @@ -61,6 +62,7 @@ that apply to this release group.` releases, relationships, collections, + rating, tags }) }) diff --git a/src/types/work.js b/src/types/work.js index fa36133..4628ee6 100644 --- a/src/types/work.js +++ b/src/types/work.js @@ -10,6 +10,7 @@ import { artists, relationships, collections, + rating, tags, fieldWithID, connectionWithExtras @@ -42,6 +43,7 @@ to the work by copyright collecting agencies.` artists, relationships, collections, + rating, tags }) }) diff --git a/test/fixtures/029295853b01dffc8f5061e3ab19a1f5 b/test/fixtures/029295853b01dffc8f5061e3ab19a1f5 new file mode 100644 index 0000000000000000000000000000000000000000..820f6f21c9a640f38bdcb09ea3953192e0887f3a GIT binary patch literal 279 zcmV+y0qFi8iwFP!0000018tDYio-ArMgK+X2<$xD?1r|?ve22`(1j8!#o#(6P70;u z-$(9?GR#i0EZuYO6~@bnq4tw=33xh64d2_<2kthj?QZ=A2^bsb*x18FqwT%S<*n@} zKMogZ)*ESQV1oJzp&v$kT>0eTNd6*IYouKiRgrdvP-kt9nWhXI<^mNLZKJzF8#3@h zcv}v={4Pt>*!G44)IU*k{~yXq9YeLfrby(KLuoTFXu-xd8%lcs}vP2 dD$EP5a1rAvm86nUUgc#8^DiNKA#$n#0052dgWLcB literal 0 HcmV?d00001 diff --git a/test/fixtures/029295853b01dffc8f5061e3ab19a1f5.headers b/test/fixtures/029295853b01dffc8f5061e3ab19a1f5.headers new file mode 100644 index 0000000..df97963 --- /dev/null +++ b/test/fixtures/029295853b01dffc8f5061e3ab19a1f5.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:57 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": "412", + "x-ratelimit-reset": "1481671678", + "server": "Plack::Handler::Starlet", + "etag": "W/\"8a5c86a2265b61562bb0731bb587d055\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/420a9402-0a87-4510-81a3-60f513a47466?inc=ratings&fmt=json", + "time": 403, + "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/053f4fa909ff28b9a7977ea4c79d3455 b/test/fixtures/053f4fa909ff28b9a7977ea4c79d3455 new file mode 100644 index 0000000000000000000000000000000000000000..a60a750c4a0fe9d4e11df50498d7a0e80ce15a29 GIT binary patch literal 322 zcmV-I0loeoiwFP!0000018tB&Yr`-Mh5t&>IRZOzoixY6*rAtE=xOYr*h(-Yc8QZh zDgEzrQo2#t&GM7bUuZ*WAa%zu&FE=du}|L3Y_o&&y$xd$|Np0euMz1pRx|Z4|G|&TZfZ2{%IIXE7g`~<45<9A}OZ$8F`<@W!#xTO!g|Ba(Vwy8F;8vGm{JAtRyG%FhmP*CNAfTk>u`;?D#!$T% zIES6~WZB~sXWqjp)=<)8A9G9v|5bW-Wy~vy;|Uz(JM?X*u{GHDl3QL}_$*r)gOmQ8)BxKHMK05AU^iwFP!0000016_{G4#FT1MgL{iodjs1*tLJ)(zxI;G$fT8peEJ$@1iT? za?ZWyW}e_AF4Evxonh+ccPY1)v6SIdV7IJIyKWc&LeEH{J_<93` KMaVxE0RRBbnP8p( literal 0 HcmV?d00001 diff --git a/test/fixtures/14d10341ea355048f1c3b6bd9a398842.headers b/test/fixtures/14d10341ea355048f1c3b6bd9a398842.headers new file mode 100644 index 0000000..2287f92 --- /dev/null +++ b/test/fixtures/14d10341ea355048f1c3b6bd9a398842.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:08 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": "118", + "x-ratelimit-reset": "1481671688", + "server": "Plack::Handler::Starlet", + "etag": "W/\"3782bf3581eed4ba0d5850dc94a0ca0d\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release-group/abd672ff-6c87-44b5-8606-5b763215cbe7?inc=ratings&fmt=json", + "time": 391, + "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/1bdc0182f4c05cf480eb9c05af4b976a b/test/fixtures/1bdc0182f4c05cf480eb9c05af4b976a new file mode 100644 index 0000000000000000000000000000000000000000..c27f7d52a4fa9c978670efd9dfd01136acec6cc0 GIT binary patch literal 310 zcmV-60m=R!iwFP!0000018tDqYQr!LgQwN!Fa(~OuIY`|2tkVaOOs);?m0k|2q I^XLHp09@IR@8pKCeCOxU%cmLAI4*aP43xg;M(8 zr)FgAu$zRW=hgE7o7TAGJB)D+p@QW;lkg5k=n%2)CKAfgBx>EY!qm+mdZ~2NH&V9B zK?S}+}&D=t1o9=|B_4%xDYqiKv& zMwpJX^`Hh}WUqv6l+{Pw$hOsdg_&@V%1nzF7$0!Mu>O8dss&c<$n9#wq5+TE_M)mJ|zX-`@9Zx?Ma(M{|RS!UPYs^8ti38akmG zu)LPaD$aH72s;u_IIre_{ z>iaypLSzGWejt?l=Gm->;3~3vgmptZ6f1UJxFW56`3(^e_jH+K7>45HE$d245Fat-;u{FMFO O>GAXaszT)REdD-$)5$~jm5 zwD>_yH(2d>dC=ylHC7}za*`bD(n!>zs}jX4eK2`92IQrbSUx>-NpSjr7e)O)dh^Te XM!(hjtSg~yR(bpaaO37KtpNZ4(dB+J literal 0 HcmV?d00001 diff --git a/test/fixtures/310dd8dea7247669130cde2559bae02f.headers b/test/fixtures/310dd8dea7247669130cde2559bae02f.headers new file mode 100644 index 0000000..224d7a7 --- /dev/null +++ b/test/fixtures/310dd8dea7247669130cde2559bae02f.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:51 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": "301", + "x-ratelimit-reset": "1481671672", + "server": "Plack::Handler::Starlet", + "etag": "W/\"68e14bbf160ea632492a141bd851d485\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/e899f760-c30e-4c74-8665-a1c34894ecf6?inc=ratings&fmt=json", + "time": 407, + "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/3bd3d3302c90a0bc9ed720a831ff3304 b/test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304 new file mode 100644 index 0000000000000000000000000000000000000000..47b8ff87953f7ebb62faab23fd1f772930cb9afb GIT binary patch literal 316 zcmV-C0mJ?uiwFP!000001AUQAYQr!PMz0cP?ExpU{(Om+hO9~#vNa9@MGBG}2qAZ` z>^7mL(47X2-uq^BgE7vbq$~7r*h2&5dM0$XmeLr*Ebmr3#vi&$L!w7xxBMeuYV5yA}l#7CWOXYB4cXdLp5; ziBcthyfHdnKLHBkApcLU4tQwGy?G5~b#YP@H$8R`49~x3CWG%|L#YJ-*HZ043-M0!0RRB*Zj&(p literal 0 HcmV?d00001 diff --git a/test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304.headers b/test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304.headers new file mode 100644 index 0000000..9172307 --- /dev/null +++ b/test/fixtures/3bd3d3302c90a0bc9ed720a831ff3304.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:02 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": "587", + "x-ratelimit-reset": "1481671684", + "server": "Plack::Handler::Starlet", + "etag": "W/\"4512b68e22d30476cb2db9ec2deb0325\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/b357e320-636d-4a8d-96f3-89fe6897544c?inc=ratings&fmt=json", + "time": 400, + "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/3d374d64c41545bf2538e8c89472ed9d b/test/fixtures/3d374d64c41545bf2538e8c89472ed9d new file mode 100644 index 0000000000000000000000000000000000000000..c5ad63a803ebb4b2f546c518bb7cd7798dbb5f73 GIT binary patch literal 317 zcmV-D0mA+tiwFP!0000019gzWYQr!LhF_)V9Dx(Zv7OsqU>oat8apVlS`4XEVy93_ z-+fNHF$&w!lJ)7=cLg7VkI;U67LYC{h8A8XfAE2Z&FeI}xleu!P(YyL(tLk@+PrZ; zPA=x+M9GH(v{yKfi6i#o91^smfHMtq{vYOHxE0_}KRcX{bnN_Lrj^@5rqIN+Fuqsp zf=}!=+e8_e+dhsc%cj9H^BpfB*li)h;y5MzZ_4FjZEVlB?67H+K`DhsYqUmfRo57$ z>fRdoE7a`~{&@939S>_3Xsb$y@~#fom70j8-ZNH?_b6-KU?-JDBdS^%B}7xX%veoL zmnHaiLHaxqPZSmp9cTY{cLi{8oVj}%BCoGssq2ONMoMEH_No$CJEf5vD-4fD|!OBv3JY2?Qjqu*)rE zL;s%H#8C_xFx0x^4i|UsJtXIurKw;qnGH;GVL?a`>QTx;%R%waPP(6L!_v4MI~(+d zjkV5&mVCpevM)Fn*iGYdn%VH{nYC31W42D#3O0EMT1NxkatkIptE4a~7Dt+M8mB_P z3(o&{5F6H8->>yA?dj=EJEy4~a5_UjpVspCcHGhahT+uP+=2Y(*8g<>TVcbCkK{AT zqB+DYJ?N|pc%g9ptVRUmBYM&~;$hYOx=dwWZH-fhn_6x&9%9=q*xPtqO%OA3`KeEB zWS7hK3gZ<9FAki@Az7=eQY(hrxO2z8kPQ1)YfBCH?6SRVUNnnx zSvrcO4OgIxs({gEC{{|8rUa|=9ccgMxWW78HtoA)CHYn<(HW_LbXvwhK(vqr@`{QA8Gi@aM?95}3pN?&gDnzJIciVW3D8Id z+{UE5%pwZS-h_RZYxTB7jsa@s8njP=67dKkB9ENg;-bET>kmvwrH?xeTyU7Zq(P7q myy%aABpoz5E85n~e9d1pol}yzN2& literal 0 HcmV?d00001 diff --git a/test/fixtures/43296de566b64880545e57a0fadb7712.headers b/test/fixtures/43296de566b64880545e57a0fadb7712.headers new file mode 100644 index 0000000..153d4ed --- /dev/null +++ b/test/fixtures/43296de566b64880545e57a0fadb7712.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:40 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": "584", + "x-ratelimit-reset": "1481671662", + "last-modified": "Tue, 13 Dec 2016 22:42:30 GMT", + "server": "Jetty(9.3.10.v20160621)", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release-group?inc=ratings&query=arid%3Ac8da2e40-bd28-4d4e-813a-bd2f51958ba8&fmt=json", + "time": 372, + "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/45daa19eb100ee93bf814b6b7c76d81e b/test/fixtures/45daa19eb100ee93bf814b6b7c76d81e new file mode 100644 index 0000000000000000000000000000000000000000..27fecb5ad4749a100f84befb85ed61fd2266235f GIT binary patch literal 312 zcmV-80muFyiwFP!0000019gziYQr!LfM2Ef96@Zy&d+_j4F)}q9pqRp2G=S1=_qCI zv-jAGP06~k!FDmWWPQ@7tC)syhKxrNow$#A=V`Z(?{9sg-2?fEq7Wm_F&{*C73X25 z3Ho8lv*^k~oG~q2n3t4Z3o&0#1kp1HRi!MV1Lb`MTDLv8s`h-eN^?@$x?%7J8ZTV1 zzvCy4glm@#p|qD}Q!5At33MnK5sYD&s+$I-rQUJP&++#!8?c~zq9iLC;ri3;K9 z5cB8SiZ%7U!OdJ68?Yq_Qa1)F*&Ar9QiG`|1R`{{?KhzuR|__Xr>|Q=M`;thF+TwA K7)+nx0RRA$B$7J- literal 0 HcmV?d00001 diff --git a/test/fixtures/45daa19eb100ee93bf814b6b7c76d81e.headers b/test/fixtures/45daa19eb100ee93bf814b6b7c76d81e.headers new file mode 100644 index 0000000..ccb50b4 --- /dev/null +++ b/test/fixtures/45daa19eb100ee93bf814b6b7c76d81e.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:46 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": "139", + "x-ratelimit-reset": "1481671666", + "server": "Plack::Handler::Starlet", + "etag": "W/\"9153a9da91c7fb7f0b5c6cef150053d1\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/156fa9e1-1385-41c5-9403-54effeeab69c?inc=ratings&fmt=json", + "time": 412, + "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/4e1f01ba60b51a0696cc97178a29068a b/test/fixtures/4e1f01ba60b51a0696cc97178a29068a new file mode 100644 index 0000000000000000000000000000000000000000..53806e102da79e7378b425fd75aa69f80b2e143f GIT binary patch literal 231 zcmV$`iX238fFj7< zOQoCc$eA|-@(K0l#ux*v;7s74=Lwx&1{^oVG8sng^rj4vGP8va-Ym19HQ64mH4{#r z37vHl^0N4#tQ(fC7dFL>vD_%b`UK9>4{N=j+_gn&2Gwg+BMyVWj`x`ViTwz#4l-R? z#LM^P>!UdW-l@jCx5@{lQ`~%})WPGZT+kn9uCOYJw$~*3$)!diC0V$pSi}ZdYJ4}# h6k?&Pi~A|XNB+}1WzQ+Ki#JMzU%%yAVjL?0008KiZ8HD> literal 0 HcmV?d00001 diff --git a/test/fixtures/4e1f01ba60b51a0696cc97178a29068a.headers b/test/fixtures/4e1f01ba60b51a0696cc97178a29068a.headers new file mode 100644 index 0000000..fb86131 --- /dev/null +++ b/test/fixtures/4e1f01ba60b51a0696cc97178a29068a.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:35 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": "371", + "x-ratelimit-reset": "1481671656", + "server": "Plack::Handler::Starlet", + "etag": "W/\"acf01548d4499ceaa8dd01a8b80d2160\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/event/eec75a81-8864-4cea-b8b4-e99cd08b29f1?inc=ratings&fmt=json", + "time": 601, + "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/6bef22d668064a78bf636a32f4b4a536 b/test/fixtures/6bef22d668064a78bf636a32f4b4a536 new file mode 100644 index 0000000000000000000000000000000000000000..2e8707931fded04e0d4a8a26d4a491e19b5f6445 GIT binary patch literal 321 zcmV-H0lxkpiwFP!0000019gzyYQr!LgBYBkNkVjv-@O zW1g=(@OI$R`2|mdKdzX4ireo~<)iad1so`_1ZTqHDB_8VAo@(MI%LeWaC=E}hJSi~ zNzgS)K?7rQ{I!2C*pENBMP1J5jUCB011Kd8bX~2%8m&QFIVdA#KXO+0-`K;ak2zJZ zG^W`V?q+>MJ`yZBvGRHL94m(EWlnA#H+HcZeeuS=X7&@0<=hK~^=JH&_#oJ_6Z@L+ T{`{Eu+r#|}4~hzC`vCv|FZi6R literal 0 HcmV?d00001 diff --git a/test/fixtures/6bef22d668064a78bf636a32f4b4a536.headers b/test/fixtures/6bef22d668064a78bf636a32f4b4a536.headers new file mode 100644 index 0000000..783431c --- /dev/null +++ b/test/fixtures/6bef22d668064a78bf636a32f4b4a536.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:51 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": "1481671672", + "server": "Plack::Handler::Starlet", + "etag": "W/\"1b5511793df8dac598ed5256ef08536d\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/2757a11f-0dbd-4f0c-97f6-f62532972898?inc=ratings&fmt=json", + "time": 414, + "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/6d67e76967cd5d93d61d515f2e6bb203 b/test/fixtures/6d67e76967cd5d93d61d515f2e6bb203 new file mode 100644 index 0000000000000000000000000000000000000000..f829614f0987e5e062e9c651d3a781bb46205656 GIT binary patch literal 210 zcmV;@04@I?iwFP!00000167VmiUTnWMem|@2|SgH)UNk^gU}1PEC)jk!9yT~+`X01 zy~t8u?+*{Cyc~O^a>sVRa)tT)GeF9vHY~g{RmMn-VFshLL#*lU*LBy5;Q=La|`#A%1{9AG@dHYu-?Q0Ev z6TC?6eu4P`x1({z<>-5ZSr2fdwF~Ka6jA~@NpIe~4?RPUsmOq5f)VZ$W$!2y@tvlaT!sTIekPeO7+`z`3XU9% zGcK79VCm%f8fv4ItTZ3SGX%!4F3ZaS5*8m$+u&m?l;srHP++VM@QBMwZ@6;3Z0o-z z&xE*$`xMk zvIrN?{O)|lv-PJHck&VV?%x334fq^oTWc+A7Vjv-_!GX|!NaR8>{W*~Td$g4w%8bH zwd-YLyNa;thMMDIgCFGUFMeZv_>Z__3@!#~F|(!xEiGbVgPTHo6`$P`Cf15M2TH;R zQ5&sq#V0N&ir*nV1%X+-?Yt4kog&Vn{30>MGnaZ5?=*>HakpFX8+vyQqfutdBD_l7 y3X^*RJtDR}f04$~EZeTv(zeRTp=vrcsH)P9W3s*Zbmaj~@8u8578z=G0ssJ+>bNlg literal 0 HcmV?d00001 diff --git a/test/fixtures/7ecaf522c01ab6ec413eebc9f2e16a42.headers b/test/fixtures/7ecaf522c01ab6ec413eebc9f2e16a42.headers new file mode 100644 index 0000000..54216e7 --- /dev/null +++ b/test/fixtures/7ecaf522c01ab6ec413eebc9f2e16a42.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:02 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": "579", + "x-ratelimit-reset": "1481671684", + "server": "Plack::Handler::Starlet", + "etag": "W/\"de349eafa16a841eba0befe68a0d6908\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/8cece665-cfb1-48da-9e68-3991021578ba?inc=ratings&fmt=json", + "time": 411, + "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/8b1602fb8d6a9d91230c48f5152a25ca b/test/fixtures/8b1602fb8d6a9d91230c48f5152a25ca new file mode 100644 index 0000000000000000000000000000000000000000..d3ec49de25c5e17c1828159c71cb33ff5800c446 GIT binary patch literal 301 zcmV+|0n+{-iwFP!0000018q^uYQr!P{FSn2FI19k#r}g_O6axZu+pxBz>$Jw2SUid zS9WNiv=_0jnVnhP!KWq8(+zsqe?SFe7zFc$BJ_7~atbAg%Q#jbk%gfjXw0%@&&H#I z`F4?lKTL@iKZg_x4^2WVMJQvyMo~wq!N%ADP1|-z+!)l2Z45JOYjwedoY1JYMTI`G zWaz(EQO626WIDTWT4B#;m*l8EZ!%(^eDFkoRq+- zNDHHKv`wY3uq7jzRAZHARi(4EG))e|C&M0_!SX?J{RM-x literal 0 HcmV?d00001 diff --git a/test/fixtures/97957d6dbc8b2d81b65d1b57c0c20810.headers b/test/fixtures/97957d6dbc8b2d81b65d1b57c0c20810.headers new file mode 100644 index 0000000..6654fe0 --- /dev/null +++ b/test/fixtures/97957d6dbc8b2d81b65d1b57c0c20810.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:41 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": "460", + "x-ratelimit-reset": "1481671662", + "server": "Plack::Handler::Starlet", + "etag": "W/\"6fc7aaee78bac7a9f58fbd576dcef194\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/e1404b13-dc91-4d7e-ab05-932995207bc3?inc=ratings&fmt=json", + "time": 388, + "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/99528bcc7f6586bde435b2b8d64b241a b/test/fixtures/99528bcc7f6586bde435b2b8d64b241a new file mode 100644 index 0000000000000000000000000000000000000000..144e446ad6dcd2c15d10c563ea0a8b8b99446462 GIT binary patch literal 209 zcmV;?051O@iwFP!0000016_>GYQr!P2H$1RT9CAs8~fIG=&kgy`U?VC4we)MA@5!V zatJx@?96wE8r)tyA2)2bOTgqStiONagTG+%u!1&fA?Gw&S{Nrb1{dZTy)t{|xA)Rul>)Au`_N0z`60lk%9~B+KK#9m6?psu LM(mZN7XbhO&pci| literal 0 HcmV?d00001 diff --git a/test/fixtures/99528bcc7f6586bde435b2b8d64b241a.headers b/test/fixtures/99528bcc7f6586bde435b2b8d64b241a.headers new file mode 100644 index 0000000..05576f4 --- /dev/null +++ b/test/fixtures/99528bcc7f6586bde435b2b8d64b241a.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:08 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": "113", + "x-ratelimit-reset": "1481671688", + "server": "Plack::Handler::Starlet", + "etag": "W/\"1e4b1d772a7ccd2b674b4d0c15077b23\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release-group/25193cc2-b39a-4a55-9aa6-d1a0fa3ba858?inc=ratings&fmt=json", + "time": 395, + "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/9cd666caa3723edc6f5438fed0898f86 b/test/fixtures/9cd666caa3723edc6f5438fed0898f86 new file mode 100644 index 0000000000000000000000000000000000000000..6939e0139a18971c54c1b2f9c2fdb138c75bb808 GIT binary patch literal 863 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 literal 0 HcmV?d00001 diff --git a/test/fixtures/a310e26b9e92f2a0bab61d4d42912714.headers b/test/fixtures/a310e26b9e92f2a0bab61d4d42912714.headers new file mode 100644 index 0000000..7194bc2 --- /dev/null +++ b/test/fixtures/a310e26b9e92f2a0bab61d4d42912714.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:35 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": "369", + "x-ratelimit-reset": "1481671656", + "server": "Plack::Handler::Starlet", + "etag": "W/\"7c40152ab47579632a5add40415303e2\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/artist?work=8a25ce1e-8695-42c0-b668-8f0aa057c72b&inc=ratings&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/ab0e9518dfae4758d6cf8280b4eb0dd1 b/test/fixtures/ab0e9518dfae4758d6cf8280b4eb0dd1 new file mode 100644 index 0000000000000000000000000000000000000000..79b8196caa61b8a1c1a164b3beed0ef7cc23c033 GIT binary patch literal 284 zcmV+%0ptE3iwFP!0000018tDeYQr!LMSrE}IRdANoj9MdQuZ+R;Mi(0xOR!1LMZw7 z+38va>ytpbx;nadP!lN_?hwP2(5nl<07q{VncX3&L=h@5Hmb{L&$CK4_$)XCzKf} zYyZCg-)YK^`*Vru7BV4jcrdUEZpzKSBpEv`SHg1kLFVjHwrMRcWiQR&po4P=rb zNed$L?k25X5L{M@I_Enl?~vcl3=`Z%d$gWhb033Q=4^w97Hsl1!SwvMg-F@@BTVn` zN^U79esQja*N{2k92TEp5| zO~a1o9D}!W<4Ch>n-{nZk(P zbxUL4(Pls)y2AzwLz>WW`!Lj&J3l7?%!gxkzX7H8y)w(5C~r z#BH6vd(m8e^>esdd#lH%j^NwWv2b;Y`ZO^TCl~dEhU}m>SUa$bK z6h-;&1vjm#HW!3=!_05qdx3=vFE|IwaP-@<9Kh49+~Lu?JI6$eIPn~!O>h8bi!kVB z=qA=^$yYiUra zVZyF!M%2?d;;09sreWx3J;C2lnXNcy%3Oi0OLQ~tx>0t)mxA(^Ld^JX{p$hdu=yOH zt8}glCGRRxp;_F8F|Fh)G<(a1F2{`zVEF24Z>hB^e~R|Ys?sh$uXW7V80u-YK7agj`gDE*aobWBh6Rb0Viw^d@(&hExP}jvcKr?e z&yN2E70YaYt()9w+5SX(55)%DJ%D5L#*cdr)b_0+GT2(%mmKtrrXOuNblVkCs&RtX MpP+-NR4@Vn0O}dFUjP6A literal 0 HcmV?d00001 diff --git a/test/fixtures/b9875f70a8e288e37b773cc13d32ec30.headers b/test/fixtures/b9875f70a8e288e37b773cc13d32ec30.headers new file mode 100644 index 0000000..a1f145c --- /dev/null +++ b/test/fixtures/b9875f70a8e288e37b773cc13d32ec30.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:46 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": "135", + "x-ratelimit-reset": "1481671666", + "server": "Plack::Handler::Starlet", + "etag": "W/\"b2b7f8758b961c96fbbe31d96afc9db9\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/590538e9-b183-4163-ab5a-171fb021ed12?inc=ratings&fmt=json", + "time": 457, + "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/bfd061a64b7aa63058ee3c14ddac6e6b b/test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b new file mode 100644 index 0000000000000000000000000000000000000000..752e5c8ca1cc5b3635e84e8d875fc040b6db5539 GIT binary patch literal 248 zcmV*vK}KqA34f zLzpFD+VQaMp%dgs!}4yR!FrPvY&(hN#)Y%aGAG=-f);~&Epr&C%Lg+0RRA!33n?1 literal 0 HcmV?d00001 diff --git a/test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b.headers b/test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b.headers new file mode 100644 index 0000000..4535a2b --- /dev/null +++ b/test/fixtures/bfd061a64b7aa63058ee3c14ddac6e6b.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:46 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": "134", + "x-ratelimit-reset": "1481671666", + "server": "Plack::Handler::Starlet", + "etag": "W/\"1e1ae4bdee078805a5520696b613b4f3\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/4d89954f-0df0-41ef-9933-e7c022841719?inc=ratings&fmt=json", + "time": 413, + "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/c7d3ce37fac463c8977f395759e7a8e8 b/test/fixtures/c7d3ce37fac463c8977f395759e7a8e8 new file mode 100644 index 0000000000000000000000000000000000000000..416d654f443f48829143cee702a737eee7ea24f7 GIT binary patch literal 214 zcmV;{04e_;iwFP!000001AUN9j>0eug|AY1T}#kGl=J}X*vxh`3pa79NWrP{gM<)w zCs4IZcDBFg=O;gaA`=W!yl+8=B01jI)+KQXhQI$7JdNy82g55Ay4D)bP8w61OAy1& zFY6FZg1Txdv;EJJttQmFZjT3j>QO0W@YI<@-}TCNimNt-nDM(^r0isZ;Q=@DWy^32 znG=3e!?1g{knc0&`}V@Uvy5pbd2h08^N}YfYg6Z3i6x)7S{Rq;I=ZRUlc9Zdn-#7Pi4YhX8d=&Mbv zL>eTOz!T(m7W)nRnjhPuWJeM&wpJSj&YRWMW>ufMooe#)#8=TaF-#s$7@-PNhABT| z{4rIJWpYJ58rGg3!%qutZ_QY!&7_tr1q-hC0&{9Pb}>p!qV$d?NrMe5 zP0wOAv&D5s)9vb)ZO*9(Nz8G8-ztNJG7dYLEQSLcrlOR3fp~L$)js-lm4lP*6uqg+ zF!xPf7Hc5zY-QTX*ZV>iz+vFvH0>~J~Jq|<&ktC7a zik0TmE8EkzT-yo|Dpj&3Qt&_~v7n&Q2*R-xF{K!-Q^v0Vxfh2;07f|I*MIwIL?Qzy<0=%Qw*^O$#QWkOhN{ji$HJ` znSx|+0z1kw9Em2DIn78SJ7aPu8XGwL@wSTt$v7oSW?0hbFwY3Z83_?fOEfo-rIgAw zy_GF|Pv3H}i^EzqqnOZD_1Z+nGq07gkU1K12ry#UX4YXwL>3Ko&ILAt0u+RZR`oP5 zF1p2Qc*p(jk_J)&)Ps{U4k4^K)Gi4%MbqS<%Emz1J?^4w3H7eXKgOzttRJqiL-LT< zcINVnxm`RM9%zgLRER`}vsgjy7wD?ILW{12FnT|Edwlfz?bFlu6EvIG4RR4#bY-gs zl?gSM5lzdB@|TTpc-Jo!nei>^ShX?1IW!)VX^pj!PGwRGZ?cVZLAyn#4RqasGp)(S zf}=fDr>}uU)7;i^*@-t2&X;BL$zHFaG%lHz-a_;*9DD1j<=P#-~eXc zu7EXbzuTY~bk@OugAaa)=G$YU=Y=1#qAUM?7JYz!w--y-+z=`HO+Qo{2+H}@q&2)J z&1ayjXnwyer)?r4U(Q@P`SRgg(ut4(F%SupkO(AQOu%C}&@T8#*eYsc*@ALzn=?MRf?$qxoU7!L0}Pmz*Z82C6rW?w6ej)VNA}i zr?A?Lz|xmKq>=$8FvCD6NY-g7<6b(t%>VkU@1p)W_u(a`rM8r|VeJAIEz>YMDV!9O zK!r8S7Wn+HVSRcD$yAPbuqW(wlXs_wC@(@Dmks2B_;@>a_D(mrj(%mo?a8I!#7qG( z0bZLt7Dj5I{I2DaDiTQzwKnbG(!(j#?-7r7We>qyYfW5ior{Zubk4lbrnv;}m2Kvg zoz{R_=mOr6{Xk3lA$;eaA7dFh-NLlqrhTMY;>HE;Bv#Qv<>aKDS{;yJNf@_MGi&t@ zX?AjUIFe+Wl3vYxSr(xzu!Fb`C{Ckqs9Z%j zs|u^7fKd|@!ZhZV!Mve@#>@#4EzCbKXY}&)1#qWO&W029R=8VT-88=+0i*K01?HMY z^zt5)Ive&8kP!$f@G62mClL#;1h{X$<~bvp zY+*0r3}(RfQP#$kQ~*XulV?yUgu)r48TP_L+(tr_TDt;$8}quJ$9seHc;-fHNLSV; z{4WNW{=@G{8|OmL3#c%~;z)Kn0!(ky-n!ErYSGIkY-Qig#=VqEF02RvdK8C96u_7; zlp_b5g9Tm{l6Q88Qh9#z`fTjtU{mz-RL1l6r9shNl%9bbiUFc=$BwtaB zknyvIcFZ%C^mTS9($fl|2xJ}~5=0#ijA!qWB03~{v&)Q(T zDOx8!lyYVs##`7s z$PU=w&z|n7_TUZ2rH&lPsp1NzR+|NER05W6QdF6N_A2}iW%snnr&Cu}W8W1F$$y># z+_N72j*e_qPV*x6y}0G>y?EF9AgNwVUKWe!IJQ1|9Fhy(7;A-9+ZV_4%V?WvydLYP zeQ}T1y37v;w?_hUEEL-L=e zz<~7@{jFpEU9!Egx)#SfEa}VkQO3Y8(go%q&4Jzt(~fy0W9_Yq7gR_XP{j^0boA`a zNc3z5C_lZd1EUC)arWZ8tVRydvonK)l1FyS~#+89}dr;NyYZA(kDlO z)B`m$Ku0h)h7v}l&UP9G-&C>A!{$7+!I}r;>r~Q6bKgb#va{WM+Szut)#Ok+CP%c$tD8YV6Tg?h^@ja+5lo@M_VKCU zQq%c29kjPpPFdh@j^CoN&}8QqgI0uaii<^#(W42nvX&s^)={k72LrY{T=y;w{eF}V z8!5PQK8B+lIX@Ki)brE$&Ys7Ef{+@YT{;~Du$OW9xB6#tOtp2al7*XK;QquI(i3Vz PW8m=x4(?KI8UX+R+cRWg literal 0 HcmV?d00001 diff --git a/test/fixtures/d748efa553f827a4594baf0f3cd2bd0e.headers b/test/fixtures/d748efa553f827a4594baf0f3cd2bd0e.headers new file mode 100644 index 0000000..7278aea --- /dev/null +++ b/test/fixtures/d748efa553f827a4594baf0f3cd2bd0e.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:08 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": "108", + "x-ratelimit-reset": "1481671688", + "server": "Plack::Handler::Starlet", + "etag": "W/\"05de0d70cc8c60f22498c500d2695695\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/release-group/f86eb0a9-fd04-48c9-810b-1ba0b006e7b4?inc=ratings&fmt=json", + "time": 402, + "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/dccbe1460fc101f36eea06bbb408df95 b/test/fixtures/dccbe1460fc101f36eea06bbb408df95 new file mode 100644 index 0000000000000000000000000000000000000000..d2928731d5b28e1ed2097fec8e35c128c1d9a0f5 GIT binary patch literal 310 zcmV-60m=R!iwFP!0000018tEzZo@DPhOZKEHUUYNZN&%3T%=>sfwGuDfFlKd1PB7( zr}yZ^D!K8{po<>-N%8xs2l%TWq5b$QV7gx!T6i0xo4d)!00lTd(#87oOlzQp6zj=y zk6m;rJIsAw01ZsgKK{-2F73jUQq+~fO0vb$2#H2G#)?E!?v-eyta9!cv6OX;=r_3=96aEb@xjt-WHqD2f2jiea^LDq^qS7j1q-56MY0Fx*_ IxY_{#0QwS{>Hq)$ literal 0 HcmV?d00001 diff --git a/test/fixtures/dccbe1460fc101f36eea06bbb408df95.headers b/test/fixtures/dccbe1460fc101f36eea06bbb408df95.headers new file mode 100644 index 0000000..3d7799b --- /dev/null +++ b/test/fixtures/dccbe1460fc101f36eea06bbb408df95.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:27:46 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": "144", + "x-ratelimit-reset": "1481671666", + "server": "Plack::Handler::Starlet", + "etag": "W/\"e0c30a6f31d6bc08657835e4c1dc4587\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/d81c44d0-e486-4db4-b128-e070a2b720f0?inc=ratings&fmt=json", + "time": 408, + "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/df91c1a5ada46ccb958bf4837b5e780e b/test/fixtures/df91c1a5ada46ccb958bf4837b5e780e new file mode 100644 index 0000000000000000000000000000000000000000..3f530ea77d65c629f3f39f8afa701e595106083b GIT binary patch literal 310 zcmV-60m=R!iwFP!0000019gzkYQr!L#$ToA9D$qoPm}w08yn;}c2I1m7+gEVNuiX! z*sgoA*`YlYwxd2t-%p>e;AyZPbu<>buzFvCGthx#Y^;ZdP?Kzt%XYv)jD$wnww6{1 zrCO-KyU}8rC_r}w8_dIFutygjMb>TZjO3HORj^#9%!2pXqettobypI(Gbr&F2&rG68BrI1l?yb`>MdW zM5nH*IO@O0NH?-|4}C-iiZ3GCfC zKI~q22(yilLAst9ot2ZiB-7eqz^+rKYZ^(3t0{!ID&mM%xCJsdA>gY72psyD?x{XpM!`W_iVfr#&2g zxAn(jjS~G=maXpjD%V7KcUP)rMb@GjxyGs(TBMu?RNYVrk1BaIKMDSR#zcmvjptt7 M2cJKd(BuIC0Pc;Jl>h($ literal 0 HcmV?d00001 diff --git a/test/fixtures/e31ec81b50d41606cac51117ade069e5.headers b/test/fixtures/e31ec81b50d41606cac51117ade069e5.headers new file mode 100644 index 0000000..80ee4dc --- /dev/null +++ b/test/fixtures/e31ec81b50d41606cac51117ade069e5.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:08 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": "122", + "x-ratelimit-reset": "1481671688", + "server": "Plack::Handler::Starlet", + "etag": "W/\"cbc5bac79c22552d56d21a2a979b5abc\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/225e2add-bfe5-41c8-a0ac-29c102723efb?inc=ratings&fmt=json", + "time": 386, + "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/e68093f6dd838e18194ecc59cddf668c b/test/fixtures/e68093f6dd838e18194ecc59cddf668c new file mode 100644 index 0000000000000000000000000000000000000000..f3792b890db6324dc6124ed00ba586f2cb540a72 GIT binary patch literal 319 zcmV-F0l@wriwFP!0000018tGZYQr!PMSmsC+5>*+-|OJWW8QR0|6UPz&0jl-wALsvUZ46%%Nfsc~T3m8?>g)&mqU-7bUxucIdo9d>VH zvU5NA6sZ~Yd2PM~e|5We*Qe2DDqElR+4$3}x490e)~7j6DzJy)x%CPWY5L zL_ayZ+fRCOtIPvas@|!}Am>bC)06_06as}}hD*lUUdeBgKN2}%Q*n;f=H=?zy8rke z#$B>5wjhyQjPNaaZO+qvs}CWJ8#|ubH!KU>c0wHl5@W74R0dVa0ZW-D+0mGqJPR6zyb+ zi-86pAuL;ROoazHEg$w%E(yE?!k@IP%W%@}IKjGOVAOLta@i=wo7H1x!{;LP@ME(P z3WX+LTFD)kT6SD_vf<-a+O6oU5ds&5e^q>ZAry~u^@b)Uo1Zb?p=u4c8Yv`lU+KAe z@fbq&*s$sgZV`33r@&WLuxU36K=X~YEtj$+)9?K* cv0&!wW!NA{ygNTA{&R5q2D})pNeBV}0ESYUAOHXW literal 0 HcmV?d00001 diff --git a/test/fixtures/fed3b13d36aab825c79fb4c130a10ca2.headers b/test/fixtures/fed3b13d36aab825c79fb4c130a10ca2.headers new file mode 100644 index 0000000..a54ec6d --- /dev/null +++ b/test/fixtures/fed3b13d36aab825c79fb4c130a10ca2.headers @@ -0,0 +1,29 @@ +{ + "statusCode": 200, + "headers": { + "date": "Tue, 13 Dec 2016 23:28:02 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": "591", + "x-ratelimit-reset": "1481671684", + "server": "Plack::Handler::Starlet", + "etag": "W/\"9c086a9b5adfde844bdff3727eec5cca\"", + "access-control-allow-origin": "*", + "content-encoding": "gzip" + }, + "url": "http://musicbrainz.org:80/ws/2/label/bacd5173-3e6a-4eb3-acec-dfbdc99aa4a6?inc=ratings&fmt=json", + "time": 393, + "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 e0838da..16e1452 100644 --- a/test/schema.js +++ b/test/schema.js @@ -826,3 +826,84 @@ test('throws an error if looking up a URL without an argument', testError, ` `, (t, errors) => { t.is(errors[0].message, 'Lookups by a field other than MBID must provide: resource') }) + +test('some entities support ratings', testData, ` + { + lookup { + event(mbid: "eec75a81-8864-4cea-b8b4-e99cd08b29f1") { + rating { + voteCount + value + } + } + work(mbid: "12b53203-64af-3a94-b3ec-11fad7c7d809") { + rating { + voteCount + value + } + } + } + browse { + artists(work: "8a25ce1e-8695-42c0-b668-8f0aa057c72b") { + edges { + node { + rating { + voteCount + value + } + } + } + } + recordings(artist: "c8da2e40-bd28-4d4e-813a-bd2f51958ba8") { + edges { + node { + rating { + voteCount + value + } + } + } + } + } + search { + labels(query: "Fin Records") { + edges { + node { + rating { + voteCount + value + } + } + } + } + releaseGroups(query: "arid:c8da2e40-bd28-4d4e-813a-bd2f51958ba8") { + edges { + node { + rating { + voteCount + value + } + } + } + } + } + } +`, (t, data) => { + const { event, work } = data.lookup + const artists = data.browse.artists.edges.map(edge => edge.node) + const recordings = data.browse.recordings.edges.map(edge => edge.node) + const labels = data.search.labels.edges.map(edge => edge.node) + const releaseGroups = data.search.releaseGroups.edges.map(edge => edge.node) + t.is(event.rating.voteCount, 0) + t.is(event.rating.value, null) + t.true(work.rating.voteCount > 0) + t.true(work.rating.value >= 4) + t.true(artists.some(artist => artist.rating.voteCount > 0)) + t.true(artists.some(artist => artist.rating.value > 3)) + t.true(recordings.some(recording => recording.rating.voteCount > 0)) + t.true(recordings.some(recording => recording.rating.value > 3)) + t.true(labels.some(label => label.rating.voteCount > 0)) + t.true(labels.some(label => label.rating.value > 3)) + t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.voteCount > 0)) + t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.value > 3)) +})