mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-04-06 15:30:30 +08:00
Merge pull request #47 from lowdefy/tests
test(graphql): add tests for graphql
This commit is contained in:
commit
ccf4a7e2a4
160
.pnp.js
generated
160
.pnp.js
generated
@ -3621,7 +3621,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@babel/core", "npm:7.11.6"],
|
||||
["@babel/preset-react", "virtual:22157ea722f8d6428f1fcf0a6f7f6c7d6b902d9c785256c60a65fe6cd0db76ebccc7c1457ee047df0ba6909ff018e300c4f4957a60f5b670089810dfc417af9b#npm:7.10.4"],
|
||||
["@lowdefy/graphql", "workspace:packages/graphql"],
|
||||
["apollo-server-express", "virtual:acf8ebf79a461c4f9f2ee32d35604720e52d54fc65cacbf3e944b2ad79cd4f17f95a2cb60cf4b37ca284c4f89981c732c25542cf20e548286d7eb31af1a6edda#npm:2.18.2"],
|
||||
["apollo-server-express", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:2.18.2"],
|
||||
["babel-loader", "virtual:acf8ebf79a461c4f9f2ee32d35604720e52d54fc65cacbf3e944b2ad79cd4f17f95a2cb60cf4b37ca284c4f89981c732c25542cf20e548286d7eb31af1a6edda#npm:8.1.0"],
|
||||
["bundle-loader", "npm:0.5.6"],
|
||||
["express", "npm:4.17.1"],
|
||||
@ -3678,7 +3678,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@babel/preset-env", "virtual:73f25cc0d3f57943fa9b1d737e4809af7a52a784e0ac5fed74b4e1e083308ab7ae2fd45a5424a8bc7ff7caab067690c9357630d657cbd636d6037acc1557fdc2#npm:7.11.5"],
|
||||
["@lowdefy/get", "workspace:packages/get"],
|
||||
["@lowdefy/type", "workspace:packages/type"],
|
||||
["apollo-server-core", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["apollo-server", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["apollo-server-testing", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["babel-jest", "virtual:60db6f885fdb292d52f611575208c6b51b9a272733d90fe8edc7853309da56cfe1d45553d3d82ff571709e87d3dd377b35bef19a5ed1bf366956f0c695b30f9d#npm:26.5.2"],
|
||||
["babel-loader", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:8.1.0"],
|
||||
@ -5674,13 +5674,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-cache-control", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.3", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-cache-control-virtual-91cabbde6c/0/cache/apollo-cache-control-npm-0.11.3-45d9ee928b-d40c6fd332.zip/node_modules/apollo-cache-control/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.3", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-cache-control-virtual-c8cae818e6/0/cache/apollo-cache-control-npm-0.11.3-45d9ee928b-d40c6fd332.zip/node_modules/apollo-cache-control/",
|
||||
"packageDependencies": [
|
||||
["apollo-cache-control", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.3"],
|
||||
["apollo-cache-control", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.3"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-env", "npm:2.4.5"],
|
||||
["apollo-server-plugin-base", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.10.1"],
|
||||
["apollo-server-plugin-base", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.10.1"],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -5715,10 +5715,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-graphql", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-graphql-virtual-7f055f916e/0/cache/apollo-graphql-npm-0.6.0-6a3e2b481b-f18999fb95.zip/node_modules/apollo-graphql/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-graphql-virtual-8c763a836b/0/cache/apollo-graphql-npm-0.6.0-6a3e2b481b-f18999fb95.zip/node_modules/apollo-graphql/",
|
||||
"packageDependencies": [
|
||||
["apollo-graphql", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-graphql", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["@types/graphql", null],
|
||||
["apollo-env", "npm:0.6.5"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
@ -5732,12 +5732,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-link", [
|
||||
["virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.2.14", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-link-virtual-ee7aab0439/0/cache/apollo-link-npm-1.2.14-74f0ba01f9-5cc96cd6df.zip/node_modules/apollo-link/",
|
||||
["virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.2.14", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-link-virtual-d747bc1ea4/0/cache/apollo-link-npm-1.2.14-74f0ba01f9-5cc96cd6df.zip/node_modules/apollo-link/",
|
||||
"packageDependencies": [
|
||||
["apollo-link", "virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.2.14"],
|
||||
["apollo-link", "virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.2.14"],
|
||||
["@types/graphql", null],
|
||||
["apollo-utilities", "virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.3.4"],
|
||||
["apollo-utilities", "virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.3.4"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["ts-invariant", "npm:0.4.4"],
|
||||
["tslib", "npm:1.14.1"],
|
||||
@ -5760,6 +5760,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"linkType": "HARD",
|
||||
}]
|
||||
]],
|
||||
["apollo-server", [
|
||||
["virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-virtual-b48bfc7532/0/cache/apollo-server-npm-2.18.2-77202a583b-bab696b73e.zip/node_modules/apollo-server/",
|
||||
"packageDependencies": [
|
||||
["apollo-server", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-core", "virtual:b64f1492aa0f9679ca70fc6827c257e8a4f0b4ed089e4a9f581dd3ff7538426986d9e795da327a051ab7cd2acfc02e6cccf2c4e761b1b7517d75fed1d0407d8f#npm:2.18.2"],
|
||||
["apollo-server-express", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:2.18.2"],
|
||||
["express", "npm:4.17.1"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["graphql-subscriptions", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:1.1.0"],
|
||||
["graphql-tools", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:4.0.8"]
|
||||
],
|
||||
"packagePeers": [
|
||||
"@types/graphql",
|
||||
"graphql"
|
||||
],
|
||||
"linkType": "HARD",
|
||||
}]
|
||||
]],
|
||||
["apollo-server-caching", [
|
||||
["npm:0.5.2", {
|
||||
"packageLocation": "./.yarn/cache/apollo-server-caching-npm-0.5.2-74bc948601-250a16c3cd.zip/node_modules/apollo-server-caching/",
|
||||
@ -5771,36 +5791,36 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-server-core", [
|
||||
["virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-core-virtual-bdd6a5c364/0/cache/apollo-server-core-npm-2.18.2-6498354fe6-c4374b24ca.zip/node_modules/apollo-server-core/",
|
||||
["virtual:b64f1492aa0f9679ca70fc6827c257e8a4f0b4ed089e4a9f581dd3ff7538426986d9e795da327a051ab7cd2acfc02e6cccf2c4e761b1b7517d75fed1d0407d8f#npm:2.18.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-core-virtual-c2454b2d17/0/cache/apollo-server-core-npm-2.18.2-6498354fe6-c4374b24ca.zip/node_modules/apollo-server-core/",
|
||||
"packageDependencies": [
|
||||
["apollo-server-core", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["apollo-server-core", "virtual:b64f1492aa0f9679ca70fc6827c257e8a4f0b4ed089e4a9f581dd3ff7538426986d9e795da327a051ab7cd2acfc02e6cccf2c4e761b1b7517d75fed1d0407d8f#npm:2.18.2"],
|
||||
["@apollographql/apollo-tools", "npm:0.4.8"],
|
||||
["@apollographql/graphql-playground-html", "npm:1.6.26"],
|
||||
["@types/graphql", null],
|
||||
["@types/graphql-upload", "npm:8.0.4"],
|
||||
["@types/ws", "npm:7.2.7"],
|
||||
["apollo-cache-control", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.3"],
|
||||
["apollo-cache-control", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.3"],
|
||||
["apollo-datasource", "npm:0.7.2"],
|
||||
["apollo-graphql", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-graphql", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["apollo-reporting-protobuf", "npm:0.6.0"],
|
||||
["apollo-server-caching", "npm:0.5.2"],
|
||||
["apollo-server-env", "npm:2.4.5"],
|
||||
["apollo-server-errors", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:2.4.2"],
|
||||
["apollo-server-plugin-base", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.10.1"],
|
||||
["apollo-server-types", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-tracing", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.4"],
|
||||
["apollo-server-errors", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:2.4.2"],
|
||||
["apollo-server-plugin-base", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.10.1"],
|
||||
["apollo-server-types", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["apollo-tracing", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.4"],
|
||||
["async-retry", "npm:1.3.1"],
|
||||
["fast-json-stable-stringify", "npm:2.1.0"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["graphql-extensions", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.12.5"],
|
||||
["graphql-extensions", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.12.5"],
|
||||
["graphql-tag", "virtual:90d4a72924f341713b457eb175224e1ec0cb1cc17fae57e4425352a06b7bd1badc2992c0aaf430411c746462d51ce4afd9da56feea73b62dad7f9bec3f6bc226#npm:2.11.0"],
|
||||
["graphql-tools", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:4.0.8"],
|
||||
["graphql-upload", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:8.1.0"],
|
||||
["graphql-tools", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:4.0.8"],
|
||||
["graphql-upload", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:8.1.0"],
|
||||
["loglevel", "npm:1.7.0"],
|
||||
["lru-cache", "npm:5.1.1"],
|
||||
["sha.js", "npm:2.4.11"],
|
||||
["subscriptions-transport-ws", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.9.18"],
|
||||
["subscriptions-transport-ws", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.9.18"],
|
||||
["uuid", "npm:8.3.1"],
|
||||
["ws", "npm:6.2.1"]
|
||||
],
|
||||
@ -5823,10 +5843,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-server-errors", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:2.4.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-errors-virtual-8d640d1eb9/0/cache/apollo-server-errors-npm-2.4.2-dc7896d913-638fc54b24.zip/node_modules/apollo-server-errors/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:2.4.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-errors-virtual-a1f26561d9/0/cache/apollo-server-errors-npm-2.4.2-dc7896d913-638fc54b24.zip/node_modules/apollo-server-errors/",
|
||||
"packageDependencies": [
|
||||
["apollo-server-errors", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:2.4.2"],
|
||||
["apollo-server-errors", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:2.4.2"],
|
||||
["@types/graphql", null],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
@ -5838,10 +5858,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-server-express", [
|
||||
["virtual:acf8ebf79a461c4f9f2ee32d35604720e52d54fc65cacbf3e944b2ad79cd4f17f95a2cb60cf4b37ca284c4f89981c732c25542cf20e548286d7eb31af1a6edda#npm:2.18.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-express-virtual-ab05aaea82/0/cache/apollo-server-express-npm-2.18.2-772b669727-ebcb732409.zip/node_modules/apollo-server-express/",
|
||||
["virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:2.18.2", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-express-virtual-f8be828370/0/cache/apollo-server-express-npm-2.18.2-772b669727-ebcb732409.zip/node_modules/apollo-server-express/",
|
||||
"packageDependencies": [
|
||||
["apollo-server-express", "virtual:acf8ebf79a461c4f9f2ee32d35604720e52d54fc65cacbf3e944b2ad79cd4f17f95a2cb60cf4b37ca284c4f89981c732c25542cf20e548286d7eb31af1a6edda#npm:2.18.2"],
|
||||
["apollo-server-express", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:2.18.2"],
|
||||
["@apollographql/graphql-playground-html", "npm:1.6.26"],
|
||||
["@types/accepts", "npm:1.3.5"],
|
||||
["@types/body-parser", "npm:1.19.0"],
|
||||
@ -5850,16 +5870,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@types/express-serve-static-core", "npm:4.17.9"],
|
||||
["@types/graphql", null],
|
||||
["accepts", "npm:1.3.7"],
|
||||
["apollo-server-core", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["apollo-server-types", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-server-core", "virtual:b64f1492aa0f9679ca70fc6827c257e8a4f0b4ed089e4a9f581dd3ff7538426986d9e795da327a051ab7cd2acfc02e6cccf2c4e761b1b7517d75fed1d0407d8f#npm:2.18.2"],
|
||||
["apollo-server-types", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["body-parser", "npm:1.19.0"],
|
||||
["cors", "npm:2.8.5"],
|
||||
["express", "npm:4.17.1"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["graphql-subscriptions", "virtual:ab05aaea828678b8e42f3f22c51372fa0cd63265fcf332ff1bb65b922c95c15771099aa33efae36c7266ad29aa8915a1cb9de96a425b1a9162e0936dc526ecc5#npm:1.1.0"],
|
||||
["graphql-tools", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:4.0.8"],
|
||||
["graphql-subscriptions", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:1.1.0"],
|
||||
["graphql-tools", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:4.0.8"],
|
||||
["parseurl", "npm:1.3.3"],
|
||||
["subscriptions-transport-ws", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.9.18"],
|
||||
["subscriptions-transport-ws", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.9.18"],
|
||||
["type-is", "npm:1.6.18"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -5870,12 +5890,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-server-plugin-base", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.10.1", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-plugin-base-virtual-8a66ce2cc1/0/cache/apollo-server-plugin-base-npm-0.10.1-4aab69d9e2-7518c4c287.zip/node_modules/apollo-server-plugin-base/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.10.1", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-plugin-base-virtual-963d44c78b/0/cache/apollo-server-plugin-base-npm-0.10.1-4aab69d9e2-7518c4c287.zip/node_modules/apollo-server-plugin-base/",
|
||||
"packageDependencies": [
|
||||
["apollo-server-plugin-base", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.10.1"],
|
||||
["apollo-server-plugin-base", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.10.1"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-types", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-server-types", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -5891,7 +5911,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
"packageDependencies": [
|
||||
["apollo-server-testing", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-core", "virtual:7fa6405098723f150ab741c1e73c906de11a676b4cc641bac8b3397ea2dd6efbb913e72a780932220533241b442cc586b41b26c7b5ac786de486992cd2db054c#npm:2.18.2"],
|
||||
["apollo-server-core", "virtual:b64f1492aa0f9679ca70fc6827c257e8a4f0b4ed089e4a9f581dd3ff7538426986d9e795da327a051ab7cd2acfc02e6cccf2c4e761b1b7517d75fed1d0407d8f#npm:2.18.2"],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -5902,10 +5922,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-server-types", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-types-virtual-ffbac05913/0/cache/apollo-server-types-npm-0.6.0-85ddd0b6f7-1ac6ded7bf.zip/node_modules/apollo-server-types/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-server-types-virtual-3f09783861/0/cache/apollo-server-types-npm-0.6.0-85ddd0b6f7-1ac6ded7bf.zip/node_modules/apollo-server-types/",
|
||||
"packageDependencies": [
|
||||
["apollo-server-types", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-server-types", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["@types/graphql", null],
|
||||
["apollo-reporting-protobuf", "npm:0.6.0"],
|
||||
["apollo-server-caching", "npm:0.5.2"],
|
||||
@ -5920,13 +5940,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-tracing", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.4", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-tracing-virtual-712d900443/0/cache/apollo-tracing-npm-0.11.4-77d3783a3e-1ac23007e3.zip/node_modules/apollo-tracing/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.4", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-tracing-virtual-dce96119c4/0/cache/apollo-tracing-npm-0.11.4-77d3783a3e-1ac23007e3.zip/node_modules/apollo-tracing/",
|
||||
"packageDependencies": [
|
||||
["apollo-tracing", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.11.4"],
|
||||
["apollo-tracing", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.11.4"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-env", "npm:2.4.5"],
|
||||
["apollo-server-plugin-base", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.10.1"],
|
||||
["apollo-server-plugin-base", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.10.1"],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -5937,10 +5957,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["apollo-utilities", [
|
||||
["virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.3.4", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-utilities-virtual-f05f794817/0/cache/apollo-utilities-npm-1.3.4-2bafd621ff-5a046f8792.zip/node_modules/apollo-utilities/",
|
||||
["virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.3.4", {
|
||||
"packageLocation": "./.yarn/$$virtual/apollo-utilities-virtual-66b8cf14cb/0/cache/apollo-utilities-npm-1.3.4-2bafd621ff-5a046f8792.zip/node_modules/apollo-utilities/",
|
||||
"packageDependencies": [
|
||||
["apollo-utilities", "virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.3.4"],
|
||||
["apollo-utilities", "virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.3.4"],
|
||||
["@types/graphql", null],
|
||||
["@wry/equality", "npm:0.1.11"],
|
||||
["fast-json-stable-stringify", "npm:2.1.0"],
|
||||
@ -10847,14 +10867,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["graphql-extensions", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.12.5", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-extensions-virtual-6b18d0a8ea/0/cache/graphql-extensions-npm-0.12.5-34878b805e-acdba97954.zip/node_modules/graphql-extensions/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.12.5", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-extensions-virtual-e4a31ef987/0/cache/graphql-extensions-npm-0.12.5-34878b805e-acdba97954.zip/node_modules/graphql-extensions/",
|
||||
"packageDependencies": [
|
||||
["graphql-extensions", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.12.5"],
|
||||
["graphql-extensions", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.12.5"],
|
||||
["@apollographql/apollo-tools", "npm:0.4.8"],
|
||||
["@types/graphql", null],
|
||||
["apollo-server-env", "npm:2.4.5"],
|
||||
["apollo-server-types", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.6.0"],
|
||||
["apollo-server-types", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.6.0"],
|
||||
["graphql", "npm:15.3.0"]
|
||||
],
|
||||
"packagePeers": [
|
||||
@ -10865,10 +10885,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["graphql-subscriptions", [
|
||||
["virtual:ab05aaea828678b8e42f3f22c51372fa0cd63265fcf332ff1bb65b922c95c15771099aa33efae36c7266ad29aa8915a1cb9de96a425b1a9162e0936dc526ecc5#npm:1.1.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-subscriptions-virtual-eaa64da89b/0/cache/graphql-subscriptions-npm-1.1.0-89d5e40c1b-3e10eebf44.zip/node_modules/graphql-subscriptions/",
|
||||
["virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:1.1.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-subscriptions-virtual-3fd9c299a1/0/cache/graphql-subscriptions-npm-1.1.0-89d5e40c1b-3e10eebf44.zip/node_modules/graphql-subscriptions/",
|
||||
"packageDependencies": [
|
||||
["graphql-subscriptions", "virtual:ab05aaea828678b8e42f3f22c51372fa0cd63265fcf332ff1bb65b922c95c15771099aa33efae36c7266ad29aa8915a1cb9de96a425b1a9162e0936dc526ecc5#npm:1.1.0"],
|
||||
["graphql-subscriptions", "virtual:b48bfc75325537b9d641f357739049b25dac71eb86a05d5744ecd259c67ce3d1110d501b0f5cd21b669aa2cda1c9f77cfe9c3e49e1202cba9683bd40f09e88bb#npm:1.1.0"],
|
||||
["@types/graphql", null],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["iterall", "npm:1.3.0"]
|
||||
@ -10896,13 +10916,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["graphql-tools", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:4.0.8", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-tools-virtual-2f6c76091a/0/cache/graphql-tools-npm-4.0.8-8345536f34-93f62ea9b1.zip/node_modules/graphql-tools/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:4.0.8", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-tools-virtual-1d9460e4f2/0/cache/graphql-tools-npm-4.0.8-8345536f34-93f62ea9b1.zip/node_modules/graphql-tools/",
|
||||
"packageDependencies": [
|
||||
["graphql-tools", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:4.0.8"],
|
||||
["graphql-tools", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:4.0.8"],
|
||||
["@types/graphql", null],
|
||||
["apollo-link", "virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.2.14"],
|
||||
["apollo-utilities", "virtual:2f6c76091aab5a76d99fc3da213c3e77cffcc01e5ed0a6ca6abb53270d723caafd08f114ccdbbbca85217abc65de61126d0eef9bf0f382740a2f17646fe72707#npm:1.3.4"],
|
||||
["apollo-link", "virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.2.14"],
|
||||
["apollo-utilities", "virtual:1d9460e4f25e67dc6fbab8cd026583a9854ca03b7e57ffb7c23c611bf85f6b9bd8ce37944d666205376796f656412b0bf4451cd60c7482eb06f06f46e7f7afa1#npm:1.3.4"],
|
||||
["deprecated-decorator", "npm:0.1.6"],
|
||||
["graphql", "npm:15.3.0"],
|
||||
["iterall", "npm:1.3.0"],
|
||||
@ -10931,10 +10951,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["graphql-upload", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:8.1.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-upload-virtual-1a0f5cca57/0/cache/graphql-upload-npm-8.1.0-c7d3bd9b21-e5fa68b3eb.zip/node_modules/graphql-upload/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:8.1.0", {
|
||||
"packageLocation": "./.yarn/$$virtual/graphql-upload-virtual-ec826a7e96/0/cache/graphql-upload-npm-8.1.0-c7d3bd9b21-e5fa68b3eb.zip/node_modules/graphql-upload/",
|
||||
"packageDependencies": [
|
||||
["graphql-upload", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:8.1.0"],
|
||||
["graphql-upload", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:8.1.0"],
|
||||
["@types/graphql", null],
|
||||
["busboy", "npm:0.3.1"],
|
||||
["fs-capacitor", "npm:2.0.4"],
|
||||
@ -19578,10 +19598,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["subscriptions-transport-ws", [
|
||||
["virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.9.18", {
|
||||
"packageLocation": "./.yarn/$$virtual/subscriptions-transport-ws-virtual-71b6179725/0/cache/subscriptions-transport-ws-npm-0.9.18-7d0f338bbd-54f23dadb3.zip/node_modules/subscriptions-transport-ws/",
|
||||
["virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.9.18", {
|
||||
"packageLocation": "./.yarn/$$virtual/subscriptions-transport-ws-virtual-0fb5816674/0/cache/subscriptions-transport-ws-npm-0.9.18-7d0f338bbd-54f23dadb3.zip/node_modules/subscriptions-transport-ws/",
|
||||
"packageDependencies": [
|
||||
["subscriptions-transport-ws", "virtual:bdd6a5c3642afb75bf2f1a25f63c4d3f135f613f1f0dc626dd3ce10291ac1ac0b0ce29109d815c76049839f1134a8c0c679fb56b4cc4e32f9e947e08a1132192#npm:0.9.18"],
|
||||
["subscriptions-transport-ws", "virtual:c2454b2d17ccf8773bac72b0fb33aec92031d79474629ad85e077201aedc53cbab2422ea96820864a7d86645e4ac62c53b660162599f53a2db963c80308c607f#npm:0.9.18"],
|
||||
["@types/graphql", null],
|
||||
["backo2", "npm:1.0.2"],
|
||||
["eventemitter3", "npm:3.1.2"],
|
||||
|
BIN
.yarn/cache/apollo-server-npm-2.18.2-77202a583b-bab696b73e.zip
vendored
Normal file
BIN
.yarn/cache/apollo-server-npm-2.18.2-77202a583b-bab696b73e.zip
vendored
Normal file
Binary file not shown.
@ -1,6 +1,7 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
@ -10,7 +11,7 @@ module.exports = {
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/test'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
coverageReporters: ['lcov', 'text'],
|
||||
errorOnDeprecated: true,
|
||||
// The test environment that will be used for testing
|
||||
testEnvironment: 'node',
|
||||
|
@ -30,7 +30,7 @@
|
||||
"dependencies": {
|
||||
"@lowdefy/get": "1.0.1",
|
||||
"@lowdefy/type": "1.0.1",
|
||||
"apollo-server-core": "2.18.2",
|
||||
"apollo-server": "2.18.2",
|
||||
"dataloader": "2.0.0",
|
||||
"graphql": "15.3.0",
|
||||
"graphql-type-json": "0.3.2"
|
||||
|
147
packages/graphql/src/context/context.test.js
Normal file
147
packages/graphql/src/context/context.test.js
Normal file
@ -0,0 +1,147 @@
|
||||
import createContext from './context';
|
||||
|
||||
import { PageController } from '../controllers/pageController';
|
||||
import { ComponentController } from '../controllers/componentController';
|
||||
|
||||
const mockLog = jest.fn();
|
||||
|
||||
const logger = {
|
||||
log: mockLog,
|
||||
};
|
||||
|
||||
const mockGetHeadersFromInput = jest.fn((input) => input.headers);
|
||||
const mockGetSecrets = jest.fn(() => ({
|
||||
CONNECTION_SECRETS: {},
|
||||
}));
|
||||
|
||||
const config = {
|
||||
DEPLOYMENT_ID: 'DEPLOYMENT_ID',
|
||||
DEPLOYMENT_NAME: 'DEPLOYMENT_NAME',
|
||||
DOMAIN_NAME: 'DOMAIN_NAME',
|
||||
CONFIGURATION_BASE_PATH: 'DOMAIN_NAME',
|
||||
logger,
|
||||
getHeadersFromInput: mockGetHeadersFromInput,
|
||||
getSecrets: mockGetSecrets,
|
||||
};
|
||||
|
||||
/* TODO:
|
||||
- headers are mapped to where used
|
||||
- connection secrets are mapped to request controller
|
||||
- secrets can only be accessed where they should be
|
||||
- CONFIGURATION_BASE_PATH is mapped to loaders
|
||||
*/
|
||||
|
||||
test('create context function', () => {
|
||||
const contextFn = createContext(config);
|
||||
expect(contextFn).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
test('context function returns context object with getController and logger', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
expect(context).toBeInstanceOf(Object);
|
||||
expect(context.logger).toBe(logger);
|
||||
expect(context.getController).toBeInstanceOf(Function);
|
||||
expect(Object.keys(context)).toEqual(['getController', 'logger']);
|
||||
});
|
||||
|
||||
test('context function returns context object with getController and logger', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
expect(context).toBeInstanceOf(Object);
|
||||
expect(context.logger).toBe(logger);
|
||||
expect(context.getController).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
test('getController returns the correct controllers', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
const pageController = context.getController('page');
|
||||
expect(pageController).toBeInstanceOf(PageController);
|
||||
const componentController = context.getController('component');
|
||||
expect(componentController).toBeInstanceOf(ComponentController);
|
||||
});
|
||||
|
||||
test('logger is mapped through', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
context.logger.log('test');
|
||||
expect(mockLog.mock.calls).toEqual([['test']]);
|
||||
});
|
||||
|
||||
test('getHeaders is called', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
await contextFn(input);
|
||||
expect(mockGetHeadersFromInput.mock.calls).toEqual([[input]]);
|
||||
});
|
||||
|
||||
test('getSecrets is called', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
await contextFn(input);
|
||||
expect(mockGetSecrets.mock.calls).toEqual([[]]);
|
||||
});
|
||||
|
||||
test('deployment variables area available for component controller', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
Origin: 'Origin',
|
||||
Host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
const componentController = context.getController('component');
|
||||
expect(componentController.DEPLOYMENT_ID).toEqual('DEPLOYMENT_ID');
|
||||
expect(componentController.DEPLOYMENT_NAME).toEqual('DEPLOYMENT_NAME');
|
||||
expect(componentController.DOMAIN_NAME).toEqual('DOMAIN_NAME');
|
||||
});
|
||||
|
||||
test('Casing of headers', async () => {
|
||||
const input = {
|
||||
headers: {
|
||||
origin: 'Origin',
|
||||
host: 'Host',
|
||||
},
|
||||
};
|
||||
const contextFn = createContext(config);
|
||||
const context = await contextFn(input);
|
||||
expect(context).toBeInstanceOf(Object);
|
||||
expect(context.logger).toBe(logger);
|
||||
expect(context.getController).toBeInstanceOf(Function);
|
||||
});
|
@ -16,7 +16,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApolloError } from 'apollo-server-core';
|
||||
import { ApolloError } from 'apollo-server';
|
||||
|
||||
class AuthenticationError extends ApolloError {
|
||||
constructor(message, additionalProperties) {
|
||||
|
101
packages/graphql/src/context/errors.test.js
Normal file
101
packages/graphql/src/context/errors.test.js
Normal file
@ -0,0 +1,101 @@
|
||||
import { ApolloError } from 'apollo-server';
|
||||
import {
|
||||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
ConfigurationError,
|
||||
TokenExpiredError,
|
||||
ServerError,
|
||||
RequestError,
|
||||
} from './errors';
|
||||
|
||||
test('AuthenticationError', () => {
|
||||
const error = new AuthenticationError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Authentication Error');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('AuthenticationError');
|
||||
expect(error.extensions.displayTitle).toEqual('Authentication Error');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('UNAUTHENTICATED');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('ForbiddenError', () => {
|
||||
const error = new ForbiddenError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Forbidden');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('ForbiddenError');
|
||||
expect(error.extensions.displayTitle).toEqual('Forbidden');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('FORBIDDEN');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('UserInputError', () => {
|
||||
const error = new UserInputError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('User Input Error');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('UserInputError');
|
||||
expect(error.extensions.displayTitle).toEqual('User Input Error');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('USER_INPUT_ERROR');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('ConfigurationError', () => {
|
||||
const error = new ConfigurationError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Configuration Error');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('ConfigurationError');
|
||||
expect(error.extensions.displayTitle).toEqual('Configuration Error');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('CONFIGURATION_ERROR');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('TokenExpiredError', () => {
|
||||
const error = new TokenExpiredError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Token Expired');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('TokenExpiredError');
|
||||
expect(error.extensions.displayTitle).toEqual('Token Expired');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('TOKEN_EXPIRED');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('ServerError', () => {
|
||||
const error = new ServerError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Server Error');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('ServerError');
|
||||
expect(error.extensions.displayTitle).toEqual('Server Error');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('INTERNAL_SERVER_ERROR');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
||||
|
||||
test('RequestError', () => {
|
||||
const error = new RequestError('Test error.', { extraProp: 'test' });
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error).toBeInstanceOf(ApolloError);
|
||||
expect(error.displayTitle).toEqual('Request Error');
|
||||
expect(error.displayMessage).toEqual('Test error.');
|
||||
expect(error.name).toEqual('RequestError');
|
||||
expect(error.extensions.displayTitle).toEqual('Request Error');
|
||||
expect(error.extensions.displayMessage).toEqual('Test error.');
|
||||
expect(error.extensions.code).toEqual('REQUEST_ERROR');
|
||||
expect(error.extensions.extraProp).toEqual('test');
|
||||
});
|
@ -17,6 +17,7 @@
|
||||
import createGetController from './getController';
|
||||
import { bootstrapContext } from '../test/testContext';
|
||||
import { PageController } from '../controllers/pageController';
|
||||
import { ComponentController } from '../controllers/componentController';
|
||||
|
||||
test('get page controller', () => {
|
||||
const getController = createGetController(bootstrapContext);
|
||||
@ -24,6 +25,12 @@ test('get page controller', () => {
|
||||
expect(pageController).toBeInstanceOf(PageController);
|
||||
});
|
||||
|
||||
test('get component controller', () => {
|
||||
const getController = createGetController(bootstrapContext);
|
||||
const componentController = getController('component');
|
||||
expect(componentController).toBeInstanceOf(ComponentController);
|
||||
});
|
||||
|
||||
test('memoise controller', () => {
|
||||
const getController = createGetController(bootstrapContext);
|
||||
const controller1 = getController('page');
|
||||
|
@ -0,0 +1,75 @@
|
||||
/*
|
||||
Copyright 2020 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { gql } from 'apollo-server';
|
||||
import runTestQuery from '../../../test/runTestQuery';
|
||||
import lowdefyGlobal from './lowdefyGlobal';
|
||||
|
||||
const mockLoadGlobal = jest.fn((id) => {
|
||||
if (id === 'global') {
|
||||
return {
|
||||
global: true,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const mockGetLowdefyGlobal = jest.fn(() => {
|
||||
return {
|
||||
global: true,
|
||||
};
|
||||
});
|
||||
|
||||
const getController = jest.fn(() => ({
|
||||
getLowdefyGlobal: mockGetLowdefyGlobal,
|
||||
}));
|
||||
|
||||
const loaders = {
|
||||
component: {
|
||||
load: mockLoadGlobal,
|
||||
},
|
||||
};
|
||||
const setters = {};
|
||||
|
||||
const GET_GLOBAL = gql`
|
||||
query getGlobal {
|
||||
lowdefyGlobal
|
||||
}
|
||||
`;
|
||||
|
||||
test('global resolver', async () => {
|
||||
const res = await lowdefyGlobal(null, null, { getController });
|
||||
expect(res).toEqual({
|
||||
global: true,
|
||||
});
|
||||
});
|
||||
|
||||
test('menu graphql', async () => {
|
||||
const res = await runTestQuery({
|
||||
gqlQuery: GET_GLOBAL,
|
||||
loaders,
|
||||
setters,
|
||||
});
|
||||
expect(res.errors).toBe(undefined);
|
||||
expect(res.data).toEqual({
|
||||
lowdefyGlobal: {
|
||||
global: true,
|
||||
deploymentId: 'test',
|
||||
deploymentName: 'Test App',
|
||||
domainName: 'test.com',
|
||||
},
|
||||
});
|
||||
});
|
182
packages/graphql/src/resolvers/queries/menu/menu.test.js
Normal file
182
packages/graphql/src/resolvers/queries/menu/menu.test.js
Normal file
@ -0,0 +1,182 @@
|
||||
/*
|
||||
Copyright 2020 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { gql } from 'apollo-server';
|
||||
import runTestQuery from '../../../test/runTestQuery';
|
||||
import menu from './menu';
|
||||
|
||||
const mockLoadMenus = jest.fn((id) => {
|
||||
if (id === 'menus') {
|
||||
return [
|
||||
{
|
||||
id: 'menu:default',
|
||||
menuId: 'default',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:0',
|
||||
type: 'MenuGroup',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:1',
|
||||
type: 'MenuLink',
|
||||
pageId: 'page',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const mockGetMenus = jest.fn(() => {
|
||||
return {
|
||||
menus: [
|
||||
{
|
||||
id: 'menu:default',
|
||||
menuId: 'default',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:0',
|
||||
type: 'MenuGroup',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:1',
|
||||
type: 'MenuLink',
|
||||
pageId: 'page',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
homePageId: 'page',
|
||||
};
|
||||
});
|
||||
|
||||
const getController = jest.fn(() => ({
|
||||
getMenus: mockGetMenus,
|
||||
}));
|
||||
|
||||
const loaders = {
|
||||
component: {
|
||||
load: mockLoadMenus,
|
||||
},
|
||||
};
|
||||
const setters = {};
|
||||
|
||||
const GET_MENUS = gql`
|
||||
fragment MenuLinkFragment on MenuLink {
|
||||
id
|
||||
type
|
||||
properties
|
||||
pageId
|
||||
url
|
||||
}
|
||||
query getMenus {
|
||||
menu {
|
||||
menus {
|
||||
id
|
||||
menuId
|
||||
properties
|
||||
links {
|
||||
...MenuLinkFragment
|
||||
... on MenuGroup {
|
||||
id
|
||||
type
|
||||
properties
|
||||
links {
|
||||
... on MenuGroup {
|
||||
id
|
||||
type
|
||||
properties
|
||||
links {
|
||||
...MenuLinkFragment
|
||||
}
|
||||
}
|
||||
...MenuLinkFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
homePageId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
test('menu resolver', async () => {
|
||||
const res = await menu(null, null, { getController });
|
||||
expect(res).toEqual({
|
||||
menus: [
|
||||
{
|
||||
id: 'menu:default',
|
||||
menuId: 'default',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:0',
|
||||
type: 'MenuGroup',
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:1',
|
||||
type: 'MenuLink',
|
||||
pageId: 'page',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
homePageId: 'page',
|
||||
});
|
||||
});
|
||||
|
||||
test('menu graphql', async () => {
|
||||
const res = await runTestQuery({
|
||||
gqlQuery: GET_MENUS,
|
||||
loaders,
|
||||
setters,
|
||||
});
|
||||
expect(res.errors).toBe(undefined);
|
||||
expect(res.data).toEqual({
|
||||
menu: {
|
||||
menus: [
|
||||
{
|
||||
id: 'menu:default',
|
||||
menuId: 'default',
|
||||
properties: null,
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:0',
|
||||
type: 'MenuGroup',
|
||||
properties: null,
|
||||
links: [
|
||||
{
|
||||
id: 'menuitem:default:1',
|
||||
type: 'MenuLink',
|
||||
properties: null,
|
||||
pageId: 'page',
|
||||
url: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
homePageId: 'page',
|
||||
},
|
||||
});
|
||||
});
|
80
packages/graphql/src/resolvers/queries/page/page.test.js
Normal file
80
packages/graphql/src/resolvers/queries/page/page.test.js
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 2020 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { gql } from 'apollo-server';
|
||||
import runTestQuery from '../../../test/runTestQuery';
|
||||
import page from './page';
|
||||
|
||||
const mockLoadPage = jest.fn((id) => {
|
||||
if (id === 'pageId') {
|
||||
return {
|
||||
id: 'page:pageId',
|
||||
type: 'PageHeaderMenu',
|
||||
pageId: 'pageId',
|
||||
blockId: 'pageId',
|
||||
};
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const mockGetPage = jest.fn(({ pageId }) => {
|
||||
return mockLoadPage(pageId);
|
||||
});
|
||||
|
||||
const getController = jest.fn(() => ({
|
||||
getPage: mockGetPage,
|
||||
}));
|
||||
|
||||
const loaders = {
|
||||
page: {
|
||||
load: mockLoadPage,
|
||||
},
|
||||
};
|
||||
const setters = {};
|
||||
|
||||
const GET_PAGE = gql`
|
||||
query getPage($id: ID!) {
|
||||
page(pageId: $id)
|
||||
}
|
||||
`;
|
||||
|
||||
test('page resolver', async () => {
|
||||
const res = await page(null, { pageId: 'pageId' }, { getController });
|
||||
expect(res).toEqual({
|
||||
id: 'page:pageId',
|
||||
type: 'PageHeaderMenu',
|
||||
pageId: 'pageId',
|
||||
blockId: 'pageId',
|
||||
});
|
||||
});
|
||||
|
||||
test('page graphql', async () => {
|
||||
const res = await runTestQuery({
|
||||
gqlQuery: GET_PAGE,
|
||||
variables: { id: 'pageId' },
|
||||
loaders,
|
||||
setters,
|
||||
});
|
||||
expect(res.errors).toBe(undefined);
|
||||
expect(res.data).toEqual({
|
||||
page: {
|
||||
id: 'page:pageId',
|
||||
type: 'PageHeaderMenu',
|
||||
pageId: 'pageId',
|
||||
blockId: 'pageId',
|
||||
},
|
||||
});
|
||||
});
|
@ -14,7 +14,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { gql } from 'apollo-server-core';
|
||||
import { gql } from 'apollo-server';
|
||||
|
||||
const typeDefs = gql`
|
||||
scalar JSON
|
||||
|
18
packages/graphql/src/test/runTestQuery.js
Normal file
18
packages/graphql/src/test/runTestQuery.js
Normal file
@ -0,0 +1,18 @@
|
||||
import { ApolloServer } from 'apollo-server';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { createTestClient } from 'apollo-server-testing';
|
||||
import typeDefs from '../schema';
|
||||
import resolvers from '../resolvers/resolvers';
|
||||
import testContext from './testContext';
|
||||
|
||||
async function runTestQuery({ gqlQuery, variables, loaders, setters }) {
|
||||
const context = await testContext({ loaders, setters });
|
||||
const server = new ApolloServer({ typeDefs, resolvers, context });
|
||||
const { query } = createTestClient(server);
|
||||
return query({
|
||||
query: gqlQuery,
|
||||
variables,
|
||||
});
|
||||
}
|
||||
|
||||
export default runTestQuery;
|
@ -14,6 +14,8 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import createGetController from '../context/getController';
|
||||
|
||||
const bootstrapContext = {
|
||||
DEPLOYMENT_ID: 'test',
|
||||
DEPLOYMENT_NAME: 'Test App',
|
||||
@ -27,4 +29,25 @@ const bootstrapContext = {
|
||||
logger: { log: () => {} },
|
||||
};
|
||||
|
||||
function testContext({ loaders, setters }) {
|
||||
const bootstrapContext = {
|
||||
DEPLOYMENT_ID: 'test',
|
||||
DEPLOYMENT_NAME: 'Test App',
|
||||
DOMAIN_NAME: 'test.com',
|
||||
ORIGIN: 'test.com',
|
||||
HOST: 'test.com',
|
||||
getLoader: (name) => loaders[name],
|
||||
getSetter: (name) => setters[name],
|
||||
getConnectionSecrets: () => {},
|
||||
logger: { log: () => {} },
|
||||
};
|
||||
bootstrapContext.getController = createGetController(bootstrapContext);
|
||||
return {
|
||||
getController: bootstrapContext.getController,
|
||||
logger: bootstrapContext.logger,
|
||||
};
|
||||
}
|
||||
|
||||
export { bootstrapContext };
|
||||
|
||||
export default testContext;
|
||||
|
23
yarn.lock
23
yarn.lock
@ -2885,7 +2885,7 @@ __metadata:
|
||||
"@babel/preset-env": 7.11.5
|
||||
"@lowdefy/get": 1.0.1
|
||||
"@lowdefy/type": 1.0.1
|
||||
apollo-server-core: 2.18.2
|
||||
apollo-server: 2.18.2
|
||||
apollo-server-testing: 2.18.2
|
||||
babel-jest: 26.5.2
|
||||
babel-loader: 8.1.0
|
||||
@ -4732,7 +4732,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"apollo-server-core@npm:2.18.2, apollo-server-core@npm:^2.18.2":
|
||||
"apollo-server-core@npm:^2.18.2":
|
||||
version: 2.18.2
|
||||
resolution: "apollo-server-core@npm:2.18.2"
|
||||
dependencies:
|
||||
@ -4787,7 +4787,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"apollo-server-express@npm:2.18.2":
|
||||
"apollo-server-express@npm:2.18.2, apollo-server-express@npm:^2.18.2":
|
||||
version: 2.18.2
|
||||
resolution: "apollo-server-express@npm:2.18.2"
|
||||
dependencies:
|
||||
@ -4849,6 +4849,21 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"apollo-server@npm:2.18.2":
|
||||
version: 2.18.2
|
||||
resolution: "apollo-server@npm:2.18.2"
|
||||
dependencies:
|
||||
apollo-server-core: ^2.18.2
|
||||
apollo-server-express: ^2.18.2
|
||||
express: ^4.0.0
|
||||
graphql-subscriptions: ^1.0.0
|
||||
graphql-tools: ^4.0.0
|
||||
peerDependencies:
|
||||
graphql: ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0
|
||||
checksum: bab696b73e6c48a08d2dec903ce49132babf96d3f35b94e6bfe297cd3d9225d89ab48d373bf6563524dec5256ff7ebd246fb94d3ab6d7c399eb4dcb781a30d66
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"apollo-tracing@npm:^0.11.4":
|
||||
version: 0.11.4
|
||||
resolution: "apollo-tracing@npm:0.11.4"
|
||||
@ -8142,7 +8157,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"express@npm:4.17.1, express@npm:^4.17.1":
|
||||
"express@npm:4.17.1, express@npm:^4.0.0, express@npm:^4.17.1":
|
||||
version: 4.17.1
|
||||
resolution: "express@npm:4.17.1"
|
||||
dependencies:
|
||||
|
Loading…
x
Reference in New Issue
Block a user