From 3f6ee91f0c5f3f74f87875351d0f0d8e1adb5733 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:08:38 +0000 Subject: [PATCH 1/4] build(deps): bump graphql-jit from 0.7.4 to 0.8.0 (#954) Bumps [graphql-jit](https://github.com/zalando-incubator/graphql-jit) from 0.7.4 to 0.8.0. - [Release notes](https://github.com/zalando-incubator/graphql-jit/releases) - [Commits](https://github.com/zalando-incubator/graphql-jit/compare/v0.7.4...v0.8.0) --- updated-dependencies: - dependency-name: graphql-jit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3d1c6a1..2bde55e2 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@fastify/websocket": "^7.0.0", "fastify-plugin": "^4.2.0", "graphql": "^16.0.0", - "graphql-jit": "^0.7.3", + "graphql-jit": "^0.8.0", "mqemitter": "^5.0.0", "p-map": "^4.0.0", "readable-stream": "^4.0.0", From e4d7b8d23b6e0acd3d253b5bb4a0c29a6076da3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 16:05:18 +0000 Subject: [PATCH 2/4] build(deps): bump actions/setup-node from 3.5.1 to 3.6.0 (#955) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.5.1 to 3.6.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3.5.1...v3.6.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f8e9bca..6e426a45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v3.6.0 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies From 394b1077ae5297717491f19aa19da99f47a7f911 Mon Sep 17 00:00:00 2001 From: Antonio Tripodi Date: Fri, 3 Feb 2023 21:57:12 +0100 Subject: [PATCH 3/4] docs(): fix link for discord server nestjs (#958) --- docs/integrations/nestjs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/integrations/nestjs.md b/docs/integrations/nestjs.md index 66f89762..ad7c195b 100644 --- a/docs/integrations/nestjs.md +++ b/docs/integrations/nestjs.md @@ -2,7 +2,7 @@ NestJS offers Fastify and Mercurius support out of the box. It also supports both schema and code-first approaches to development. We'll be covering the code-first approach, as it is used more commonly. -> **Note**: Support for NestJS can be found at their [Discord server](https://discord.gg/ErA7cNkK). +> **Note**: Support for NestJS can be found at their [Discord server](https://discord.com/invite/G7Qnnhy). ## Installation @@ -224,6 +224,6 @@ This is just a short and rough example of how to get going with NestJS and Mercu If you'd like to continue with Nest and Mercurius and learn more about Nest, please do read the [documention on the NestJS website](https://docs.nestjs.com/). The two make a really great combination in terms of developer experience. -Should you need any help with Nest, they have a [great support community](https://discord.gg/ErA7cNkK). Please go there for support with NestJS questions or issues. +Should you need any help with Nest, they have a [great support community](https://discord.com/invite/G7Qnnhy). Please go there for support with NestJS questions or issues. From a3eb6babf7dabcd0eebec05974207a12543d8456 Mon Sep 17 00:00:00 2001 From: Davide Fiorello Date: Fri, 10 Feb 2023 18:46:23 +0100 Subject: [PATCH 4/4] fix: add __resolveReference support (#960) --- index.js | 4 ++++ test/app-decorator.js | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/index.js b/index.js index 181d7855..67e85f3c 100644 --- a/index.js +++ b/index.js @@ -271,6 +271,10 @@ const plugin = fp(async function (app, opts) { ...fields[prop], ...resolver[prop] } + } else if (prop === '__resolveReference') { + // TODO Investigate a way to remove this requirement + // Required to integrate the gateway + type.resolveReference = resolver[prop] } else if (fields[prop]) { fields[prop].resolve = resolver[prop] } else { diff --git a/test/app-decorator.js b/test/app-decorator.js index 39908609..dded089b 100644 --- a/test/app-decorator.js +++ b/test/app-decorator.js @@ -1407,3 +1407,30 @@ test('support ast input on external requests', async (t) => { } }) }) + +test('defineResolvers should support __resolveReference', async (t) => { + const app = Fastify() + const schema = ` + type Query { + me: User + } + type User { + id: String + } + ` + const resolvers = { + User: { + __resolveReference: async () => ({ id: 1 }) + } + } + + app.register(GQL, { schema }) + + app.register(async function (app) { + app.graphql.defineResolvers(resolvers) + t.pass('No errors occurred') + }) + + // needed so that graphql is defined + await app.ready() +})