{"_id":"@autotelic/mercurius-remote-schema","_rev":"3-6cc417cd8f4f79268554febd5d6ead49","name":"@autotelic/mercurius-remote-schema","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@autotelic/mercurius-remote-schema","version":"0.1.0","description":"A plugin for fetching and stitching remote schemas with mercurius","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap --100 -j1 -R classic","example":"echo no example provided","lint":"standard","fix":"npm run lint -- --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/mercurius-remote-schema.git"},"keywords":["graphql","plugin","fastify","mercurius"],"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/mercurius-remote-schema/issues"},"homepage":"https://github.com/autotelic/mercurius-remote-schema#readme","dependencies":{"@graphql-tools/stitch":"^7.5.2","@graphql-tools/wrap":"^7.0.8","fastify-plugin":"^3.0.0"},"devDependencies":{"fastify":"^3.15.1","fastify-cli":"^2.5.1","got":"^11.8.2","graphql":"^15.5.0","lint-staged":"^10.2.11","mercurius":"^7.6.0","standard":"^16.0.3","tap":"^15.0.6"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"7a0876458f974b6b93f5b284e478037920965615","_id":"@autotelic/mercurius-remote-schema@0.1.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-pnr3B/YEArBSllcAkmejlyAHPXahy7acLFrgMEg24QS+NP+nFeERI1as590HWyDwV5Km54kQDSOKseiU6+GTWg==","shasum":"fa2086465173c9ec8a7b86eb196e96de1adc63c6","tarball":"https://registry.npmjs.org/@autotelic/mercurius-remote-schema/-/mercurius-remote-schema-0.1.0.tgz","fileCount":10,"unpackedSize":12357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk0ARCRA9TVsSAnZWagAAEgkP/2vhZZCupIb/HxGvLuDj\nceUeqa9VFMVJtvBdfATuHLaYfexl2CkSx5k6VNdNcamVOAuiVnweAHwEN8l6\nyzQ31Hkzr13wtycZeWeJq8wf9a27fXCi8J5VUICV0gSYwWSuNHw21uj7SLpb\n/U6XUwKRrD1xDLhxRkTHbp/i2tOmuQLDjq/DxrNAGTritRuLdnGKX2nBRvPf\nULdfvnYUjc2A/FMkaClR/Y2jtschP9M3B1kn5r8ru4GUg4M9ugZE61VytlGQ\nI+pyf/dYNoTpf+PzMTYcVr8l71KL8aDAEZbqC4Ny1q28/X5IE5N9ji58AKhW\nwvKDZUVgtjWelwKedanoVLobepIzQNqwZInrVzzjL2spQQJwenp+8mezs0Xt\nwrW2wvR5oaAyR+1XzTpZjcsxss14/0P4/la9FpXKsIEKlPA2nNbPZoMCgVDM\n8nhLMmHtqfnjaB0+tOyiRzQv+eDFDJd0O78hPU2vv1VwCRrHak5Cxa1TBGUU\nW5oI2ktZJTxRkp00PUnLK1aw7Hse5Yii/GZ71CjZ+X1ttKrdt7GQz+2lRr4n\nQ+JWQoaMlSBhQslR6lB9T1v9JkjWiHc0MwDJU5dw86HI6mhdlEbNDet0puSf\nfKxz6E5OBmCoCfpcUEgQI4oVXzsDrSfN1KTnZ7QZevmlIG+NXAYMEGo+i/gD\nev1S\r\n=kp70\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuJHOoorM4lxjomQ2QeU6Iyovs/KOD6iFXzNqNK9ScgAiBrn7ctHaCNTwxPyv/UryxvWIjRF5g3Z38hihupN92Oww=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mercurius-remote-schema_0.1.0_1620262929293_0.10242062200377888"},"_hasShrinkwrap":false},"0.1.1":{"name":"@autotelic/mercurius-remote-schema","version":"0.1.1","description":"A plugin for fetching and stitching remote schemas with mercurius","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap --100 -j1 -R classic","example":"echo no example provided","lint":"standard","fix":"npm run lint -- --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/mercurius-remote-schema.git"},"keywords":["graphql","plugin","fastify","mercurius"],"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/mercurius-remote-schema/issues"},"homepage":"https://github.com/autotelic/mercurius-remote-schema#readme","dependencies":{"@graphql-tools/stitch":"^7.5.2","@graphql-tools/wrap":"^7.0.8","fastify-plugin":"^3.0.0"},"devDependencies":{"fastify":"^3.15.1","fastify-cli":"^2.5.1","got":"^11.8.2","graphql":"^15.5.0","lint-staged":"^11.0.0","mercurius":"^7.6.0","standard":"^16.0.3","tap":"^15.0.6"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"33d91624279411f842ba56520df40c4c75b5f123","_id":"@autotelic/mercurius-remote-schema@0.1.1","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-tzNV32kNxgDbHUBROwVbz2ka9e4YY/4QS0ykTj+425YAHqO8dTRBoLph7h5w5uXpY6ZcI8XCrknQYTYuL/xjDA==","shasum":"d8bc353915f94e8d0ded463aac68605255dd7003","tarball":"https://registry.npmjs.org/@autotelic/mercurius-remote-schema/-/mercurius-remote-schema-0.1.1.tgz","fileCount":10,"unpackedSize":19499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmuB3CRA9TVsSAnZWagAAvHgP/0MG5zXcqxt7eNicddnZ\nqvP7+kMqkIQ50Q0Z6qa2HSDjEj9GBnNeD/MzYxZ6lPBUcm6sqipgjykY5qhq\nfdHYiNWbS7ho1/ob58cTSHeCcTWHA5W2y1ePmZEkJr1pVIzp+t1ifggLY+Qr\nbXJq7jPFie5AA8wIlkBL+CaSoB2DsLNxmr7AgmDTUIBLDMFKa6XtMx6dn7eT\nfc6VuJesScakpK9N6CZ2jJ2K3A/fxdDxkwrD3S7BxWYqK6B7yTVCOe+F7WPF\nJ2oW14x1y6GQHq+DFTWLXV2KajB6pg1SPJZftNTllfBk7imvy8aQ7uzKCr2N\nG2LicbyEfNYbhLcPV/mlC5ZON5DL+dipx2JEGsNVqEmSuGK8C9MvsHxhOFiv\nTspRxA2xsxgByLj1bi80jK/0BingjyLuNB47vn6j8QhW7uLRfHp47qv51D+y\nIQt7jTDWZOazGu+/fkfoxtgcnkQVp9de6I2b6aGiv7Q39rNJV+hWQe1JzYo3\nnlMvVGfCO17rB/YXyLVCfa4v5iA2CptlK9fLjfWSQ/mtW8DNVSigqgrMJHB+\nNXeIBAaCRGPVfnnkU5/jyhOE5p9m1E7kkKnKCz5/CVezbJgKvvBqTmNHO4WS\nyqfGrbnbv93tXk1/Ukf3WybPjaPptHWWkDh35pr39dgSyYObmoqaejz4GaiB\neOGc\r\n=wNWL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbBUBMGxk/c7ODWs+UdlhVi6/Ze555gvx9G6gH2bfXEgIhAIwScnSWW0MqJuDaU7Xrilwg49Jln4ET14ipu4VGewOH"}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mercurius-remote-schema_0.1.1_1620762742966_0.8433960383467825"},"_hasShrinkwrap":false},"0.1.2":{"name":"@autotelic/mercurius-remote-schema","version":"0.1.2","description":"A plugin for fetching and stitching remote schemas with mercurius","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap --100 -j1 -R classic","example":"echo no example provided","lint":"standard","fix":"npm run lint -- --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/mercurius-remote-schema.git"},"keywords":["graphql","plugin","fastify","mercurius"],"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/mercurius-remote-schema/issues"},"homepage":"https://github.com/autotelic/mercurius-remote-schema#readme","dependencies":{"@autotelic/graphql-schema-tools":"^0.3.0","@graphql-tools/stitch":"^7.5.2","@graphql-tools/wrap":"^7.0.8","fastify-plugin":"^3.0.0"},"devDependencies":{"fastify":"^3.15.1","fastify-cli":"^2.5.1","got":"^11.8.2","graphql":"^15.5.0","lint-staged":"^11.0.0","mercurius":"^7.6.0","standard":"^16.0.3","tap":"^15.0.6"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"8e5a0a6790adc8b3e14546e472c58b6945833e6c","_id":"@autotelic/mercurius-remote-schema@0.1.2","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-mCB/u5daFtFyEvbGhD2hc4D00zaxCTipBB4vfPVZtyDWTbj22HWhPwr0S2OKyr8O5nd+dBQwPUxqV3wdAIEQdQ==","shasum":"b54c77a22d26d2fd9d3a3094772979ebcf89afa8","tarball":"https://registry.npmjs.org/@autotelic/mercurius-remote-schema/-/mercurius-remote-schema-0.1.2.tgz","fileCount":10,"unpackedSize":25054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt7dYCRA9TVsSAnZWagAAJPUP/RHMgaE7AeUA0dmw3S56\ncsS7PTjkwiybGNk3kh7g2CzgSU17kbNdO6btfUeKmuBwFXWUInnTNhjA5XCW\nUYTwM8ZtVZ3LdYviwDAne2AlW3jcpyv2z1iM3xTHir0/naK1dyg8nQhat7yV\nzDNb7NDL+IC22bQozxWH9P3Fhcg0tHgB9ui5675jtbdSA/iYMBwlv4I3Dfh9\njhQTQxI9ECIxnjHpV1ebP6BmFss8dY7vlCrH/mQRM3X7oQWKu0tQpUFofd3+\nCljpXgjg10QRnpRUm0HjVS+YVeBFiCEwfivxCphX35aXythZ8gZ3BsIsDh7j\n1KaT3ilg3mJBmb3ZUxt/6fo3OHCDdKlCk7VBL6g+f0IolwHDpQpG6FdLzBP9\neAEnyrGiVkaSSSIloS6rYi3nJlSnuaAmEEtS0cKE/82XYUSBpZCU62brVUsh\nh1CzMh14c4BEoSD99xXq13ysl4y6xrDuyjCQWad47xYawOzcolWu3RSi834N\n2HAMofdLqGT9jBzhqz7mOo6Tv7KyKvTLjjgKwcQmKdBELmXgwMJfApqmv4/j\nDXh7WQNoFqFgwBLk09Euj//Ge/vbmVL+E2pBtZNTCj1H/EqwyIfdFTUITCqd\nQr799/1dfEq6NJCzaF5uEy4n4O5rm2GrD3e9m04aZNJihGkgXw+TNBt52SVi\nIMID\r\n=uyzB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKbJ3i1hBjk8n5tnS8zuU15gskbTMhMHf9WUq47CaCdAiBieWmNEO25Ewgbd/0zPeXVKtcYJZ7mzrrSjkZWXVLE4Q=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mercurius-remote-schema_0.1.2_1622652759321_0.03890246238832207"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-06T01:02:09.249Z","0.1.0":"2021-05-06T01:02:09.414Z","modified":"2022-04-04T16:40:50.430Z","0.1.1":"2021-05-11T19:52:23.151Z","0.1.2":"2021-06-02T16:52:40.012Z"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"description":"A plugin for fetching and stitching remote schemas with mercurius","homepage":"https://github.com/autotelic/mercurius-remote-schema#readme","keywords":["graphql","plugin","fastify","mercurius"],"repository":{"type":"git","url":"git+https://github.com/autotelic/mercurius-remote-schema.git"},"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"bugs":{"url":"https://github.com/autotelic/mercurius-remote-schema/issues"},"license":"MIT","readme":"# mercurius-remote-schema\n\nA plugin for using remote schemas with [Mercurius](https://mercurius.dev).\n\n## Usage\n\n```sh\nnpm i @autotelic/mercurius-remote-schema\n```\n#### Example\n\n```js\nconst remoteSchema = require('@autotelic/mercurius-remote-schema')\n\nfunction myPlugin (fastify, opts) {\n  // Create an [executor](https://www.graphql-tools.com/docs/remote-schemas/#creating-an-executor) for interacting with the remote schema.\n  const createExecutor = (url) => async ({ document, variables }) => {\n    const query = print(document);\n    const { body } = await got.post(url, {\n      json: { query, variables },\n      responseType: 'json'\n    });\n    return body\n  };\n\n  const executor = createExecutor('http://example.com/graphql')\n\n  // Introspect the remote schema and stitch it together with the existing mercurius\n  // service schema.\n  fastify.register(remoteSchema, {\n    subschemas: [{ executor }]\n  })\n  // Once the remote schema plugin has been loaded, you may also use the graphql.\n  // addRemoteSchemas decorator.\n  fastify.graphql.addRemoteSchemas([{ someOtherRemoteSchemaExecutor }])\n```\n\n## API\n\n### Plugin `options`\n\nmercurius-remote-schema accepts the following *optional* configuration:\n\n - #### `subschemas`\n\n   - An array of subschema [configuration objects](https://www.graphql-tools.com/docs/stitch-combining-schemas#subschema-configs)\n\n      | field | description | required |\n      |-------|-------------|----------|\n      | executor | A graphql remote schema [executor](https://www.graphql-tools.com/docs/remote-schemas/#creating-an-executor) | yes |\n      |transforms| An array of graphql [transforms](https://www.graphql-tools.com/docs/schema-wrapping/#built-in-transforms) | no |\n      | subscriber | A graphql [subscriber](https://www.graphql-tools.com/docs/remote-schemas#creating-a-subscriber) | no |\n\n - #### `stitchSchemaOpts`\n   - Options object to be passed to [stitchSchemas](https://www.graphql-tools.com/docs/stitch-api#stitchschemas)\n\n - #### `pollingInterval`\n   - The interval (in milliseconds) in which service should poll the remote services to refresh its schema. If left undefined there will be no automated refresh behavior\n   configured unless the `autoRefreshRemoteSchemas` decorator is used.\n\n - #### `localSubschemaOpts`\n   - A subschema [configuration object](https://www.graphql-tools.com/docs/stitch-combining-schemas#subschema-configs). Note `schema` is pre-configured and will not\n   be overridden.\n\n### `Decorators`\n\n*Note* All decorators are added to the `graphql` namespace.\n\n#### `addRemoteSchemas`\n\n`mercurius-remote-schema` adds a `fastify.graphql.addRemoteSchemas` decorator to allow\nadding additional remote schemas after plugin initialization.\n\nIt accepts the following arguments:\n\n- `subschemas`: An array of subschema configuration objects.\n\n#### `refreshRemoteSchemas`\n\nMay be invoked to trigger a refetch of all registered remote schemas and re-stitch the service schema.\n\n#### `autoRefreshRemoteSchemas`\n\nUsed to enable automatic polling and refreshing of remote schemas.\n\nIt accepts the following arguments:\n\n- `interval`: The polling interval (in milliseconds)\n\n#### `stopAutoRefreshRemoteSchemas`\n\nUsed to stop the automated remote schema refresh behavior.\n","readmeFilename":"README.md"}