mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Improve coverage with more schema tests
This commit is contained in:
parent
31fecabfda
commit
5b41af6e6a
24 changed files with 358 additions and 22 deletions
|
|
@ -1,22 +1,22 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 07 Dec 2016 23:09:35 GMT",
|
||||
"date": "Thu, 08 Dec 2016 22:10:36 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": "361",
|
||||
"x-ratelimit-reset": "1481152175",
|
||||
"x-ratelimit-remaining": "547",
|
||||
"x-ratelimit-reset": "1481235037",
|
||||
"last-modified": "Wed, 09 Nov 2016 23:43:24 GMT",
|
||||
"server": "Jetty(9.3.10.v20160621)",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/recording?query=Burn%20the%20Witch&fmt=json",
|
||||
"time": 744,
|
||||
"time": 604,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
|
|
|
|||
BIN
test/fixtures/157ce6484de07a7e2ee93b54e8244e27
vendored
Normal file
BIN
test/fixtures/157ce6484de07a7e2ee93b54e8244e27
vendored
Normal file
Binary file not shown.
29
test/fixtures/157ce6484de07a7e2ee93b54e8244e27.headers
vendored
Normal file
29
test/fixtures/157ce6484de07a7e2ee93b54e8244e27.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:38 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": "679",
|
||||
"x-ratelimit-reset": "1481235039",
|
||||
"last-modified": "Thu, 08 Dec 2016 21:32:00 GMT",
|
||||
"server": "Jetty(9.3.10.v20160621)",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/label?limit=1&query=Apple%20Records&fmt=json",
|
||||
"time": 1473,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/456168a862ec0ca28127f067e3f166e7
vendored
BIN
test/fixtures/456168a862ec0ca28127f067e3f166e7
vendored
Binary file not shown.
|
|
@ -1,22 +1,22 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 07 Dec 2016 23:09:34 GMT",
|
||||
"date": "Thu, 08 Dec 2016 22:10: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": "596",
|
||||
"x-ratelimit-reset": "1481152175",
|
||||
"x-ratelimit-remaining": "250",
|
||||
"x-ratelimit-reset": "1481235035",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"70e9c6b355083588be1b5abb2e76e291\"",
|
||||
"etag": "W/\"39c7b86496389329f958f3d9d8599d32\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/c8da2e40-bd28-4d4e-813a-bd2f51958ba8?fmt=json",
|
||||
"time": 361,
|
||||
"time": 3316,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
|
|
|
|||
BIN
test/fixtures/6044ddc15443664659ef91c3c73c0776
vendored
Normal file
BIN
test/fixtures/6044ddc15443664659ef91c3c73c0776
vendored
Normal file
Binary file not shown.
29
test/fixtures/6044ddc15443664659ef91c3c73c0776.headers
vendored
Normal file
29
test/fixtures/6044ddc15443664659ef91c3c73c0776.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:44 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": "1481235045",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"1bb5095802d059afef4624c8e955cac9\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/300c4c73-33ac-4255-9d57-4e32627f5e13?inc=artist-rels&fmt=json",
|
||||
"time": 2141,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/69d9c8738fe3ea4883276fd8fc9979ce
vendored
Normal file
BIN
test/fixtures/69d9c8738fe3ea4883276fd8fc9979ce
vendored
Normal file
Binary file not shown.
29
test/fixtures/69d9c8738fe3ea4883276fd8fc9979ce.headers
vendored
Normal file
29
test/fixtures/69d9c8738fe3ea4883276fd8fc9979ce.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:44 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": "552",
|
||||
"x-ratelimit-reset": "1481235045",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"6ef3837bacadc37c2b7f98ef14494ffa\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/0d4ab0f9-bbda-4ab1-ae2c-f772ffcfbea9?inc=artist-rels&fmt=json",
|
||||
"time": 2139,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/9247bb00fc5e2e0dcf1fcd269df8b94e
vendored
Normal file
BIN
test/fixtures/9247bb00fc5e2e0dcf1fcd269df8b94e
vendored
Normal file
Binary file not shown.
29
test/fixtures/9247bb00fc5e2e0dcf1fcd269df8b94e.headers
vendored
Normal file
29
test/fixtures/9247bb00fc5e2e0dcf1fcd269df8b94e.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:38 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": "381",
|
||||
"x-ratelimit-reset": "1481235039",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"39e8c37928b3a6031027cd8ab314a49d\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/release?label=cf7fc5cf-e011-4ef4-b511-cd0188537910&limit=1&fmt=json",
|
||||
"time": 525,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/97ec62634d0a8953ab3ba2ffce984a83
vendored
Normal file
BIN
test/fixtures/97ec62634d0a8953ab3ba2ffce984a83
vendored
Normal file
Binary file not shown.
29
test/fixtures/97ec62634d0a8953ab3ba2ffce984a83.headers
vendored
Normal file
29
test/fixtures/97ec62634d0a8953ab3ba2ffce984a83.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:47 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": "297",
|
||||
"x-ratelimit-reset": "1481235047",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"40e494f99de2f93d29eb00587cf919e8\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/ba550d0e-adac-4864-b88b-407cab5e76af?inc=artist-rels&fmt=json",
|
||||
"time": 578,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/a81703ff2de3c55fdf82ff4d0a1f5052
vendored
BIN
test/fixtures/a81703ff2de3c55fdf82ff4d0a1f5052
vendored
Binary file not shown.
|
|
@ -1,22 +1,22 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 07 Dec 2016 23:09:35 GMT",
|
||||
"date": "Thu, 08 Dec 2016 22:10:36 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": "154",
|
||||
"x-ratelimit-reset": "1481152175",
|
||||
"x-ratelimit-remaining": "396",
|
||||
"x-ratelimit-reset": "1481235037",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"141f49e0130d012e9f5ffc328bc55045\"",
|
||||
"etag": "W/\"94bf3bba877af6290e53de6524fcbdf3\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/release-group?artist=c8da2e40-bd28-4d4e-813a-bd2f51958ba8&inc=artist-credits&fmt=json",
|
||||
"time": 379,
|
||||
"time": 490,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
|
|
|
|||
BIN
test/fixtures/b1df6f5637b0de25ce9f54874c8ecffc
vendored
Normal file
BIN
test/fixtures/b1df6f5637b0de25ce9f54874c8ecffc
vendored
Normal file
Binary file not shown.
29
test/fixtures/b1df6f5637b0de25ce9f54874c8ecffc.headers
vendored
Normal file
29
test/fixtures/b1df6f5637b0de25ce9f54874c8ecffc.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:44 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": "1481235045",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"ff712330ac15db00e8bfb935e809bf95\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/49a51491-650e-44b3-8085-2f07ac2986dd?inc=artist-rels&fmt=json",
|
||||
"time": 2134,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/c907a9892b9dacd1c8f6a85cf9b95fb9
vendored
Normal file
BIN
test/fixtures/c907a9892b9dacd1c8f6a85cf9b95fb9
vendored
Normal file
Binary file not shown.
29
test/fixtures/c907a9892b9dacd1c8f6a85cf9b95fb9.headers
vendored
Normal file
29
test/fixtures/c907a9892b9dacd1c8f6a85cf9b95fb9.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:42 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": "574",
|
||||
"x-ratelimit-reset": "1481235043",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"a60590c307227cfa6ee8fff91153f1bc\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist?release=2ac3cbf2-f0d0-3678-af5f-b62dcb051bc0&inc=artist-rels&fmt=json",
|
||||
"time": 1544,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/d1a0073e6dcac919d8fdf8be12bfcbec
vendored
Normal file
BIN
test/fixtures/d1a0073e6dcac919d8fdf8be12bfcbec
vendored
Normal file
Binary file not shown.
29
test/fixtures/d1a0073e6dcac919d8fdf8be12bfcbec.headers
vendored
Normal file
29
test/fixtures/d1a0073e6dcac919d8fdf8be12bfcbec.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:47 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": "299",
|
||||
"x-ratelimit-reset": "1481235047",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"fa1c3dc12994eab7fe0dcb44b627373c\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/4d5447d7-c61c-4120-ba1b-d7f471d385b9?inc=artist-rels&fmt=json",
|
||||
"time": 538,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/f2a7af3e3a39e31ee0d9d74b5820ebff
vendored
Normal file
BIN
test/fixtures/f2a7af3e3a39e31ee0d9d74b5820ebff
vendored
Normal file
Binary file not shown.
29
test/fixtures/f2a7af3e3a39e31ee0d9d74b5820ebff.headers
vendored
Normal file
29
test/fixtures/f2a7af3e3a39e31ee0d9d74b5820ebff.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Thu, 08 Dec 2016 22:10:44 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": "550",
|
||||
"x-ratelimit-reset": "1481235045",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"8816493f7872c79a0eabce9b71262302\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/artist/42a8f507-8412-4611-854f-926571049fa0?inc=artist-rels&fmt=json",
|
||||
"time": 2138,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/3.1.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,11 +8,9 @@ import createLoaders from '../src/loaders'
|
|||
|
||||
sepia.fixtureDir(path.join(__dirname, 'fixtures'))
|
||||
|
||||
test.beforeEach(t => {
|
||||
const client = new MusicBrainz()
|
||||
const loaders = createLoaders(client)
|
||||
t.context = { client, loaders }
|
||||
})
|
||||
const client = new MusicBrainz()
|
||||
const loaders = createLoaders(client)
|
||||
const context = { client, loaders }
|
||||
|
||||
test('schema has a lookup query', t => {
|
||||
const query = `
|
||||
|
|
@ -26,7 +24,7 @@ test('schema has a lookup query', t => {
|
|||
}
|
||||
}
|
||||
`
|
||||
return graphql(schema, query, null, t.context).then(result => {
|
||||
return graphql(schema, query, null, context).then(result => {
|
||||
t.deepEqual(result, {
|
||||
data: {
|
||||
lookup: {
|
||||
|
|
@ -58,7 +56,7 @@ test('schema has a search query', t => {
|
|||
}
|
||||
}
|
||||
`
|
||||
return graphql(schema, query, null, t.context).then(result => {
|
||||
return graphql(schema, query, null, context).then(result => {
|
||||
const { recordings } = result.data.search
|
||||
t.true(recordings.totalCount > 0)
|
||||
t.true(recordings.edges.length === 25)
|
||||
|
|
@ -89,10 +87,87 @@ test('schema has a browse query', t => {
|
|||
}
|
||||
}
|
||||
`
|
||||
return graphql(schema, query, null, t.context).then(result => {
|
||||
return graphql(schema, query, null, context).then(result => {
|
||||
const { releaseGroups } = result.data.browse
|
||||
t.true(releaseGroups.totalCount > 0)
|
||||
t.true(releaseGroups.edges.length > 0)
|
||||
releaseGroups.edges.forEach(edge => t.truthy(edge.node.title))
|
||||
})
|
||||
})
|
||||
|
||||
test('supports deeply nested queries', t => {
|
||||
const query = `
|
||||
query AppleRecordsMarriages {
|
||||
search {
|
||||
labels(query: "Apple Records", first: 1) {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
disambiguation
|
||||
country
|
||||
releases(first: 1) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
date
|
||||
artists {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
...bandMembers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment bandMembers on Artist {
|
||||
relationships {
|
||||
artists(direction: "backward", type: "member of band") {
|
||||
edges {
|
||||
node {
|
||||
type
|
||||
target {
|
||||
... on Artist {
|
||||
name
|
||||
...marriages
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment marriages on Artist {
|
||||
relationships {
|
||||
artists(type: "married") {
|
||||
edges {
|
||||
node {
|
||||
type
|
||||
direction
|
||||
begin
|
||||
end
|
||||
target {
|
||||
... on Artist {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
return graphql(schema, query, null, context).then(result => {
|
||||
const { labels } = result.data.search
|
||||
t.true(labels.edges.length > 0)
|
||||
t.is(labels.edges[0].node.releases.edges.length, 1)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue