Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fastify example standard fetch #3539

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions examples/fastify/__integration-tests__/fastify.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import request from 'supertest';
import { createDeferred } from '@graphql-tools/utils';
import { fetch } from '@whatwg-node/fetch';
import { eventStream } from '../../../packages/graphql-yoga/__tests__/utilities.js';
import { buildApp } from '../src/app.js';

Expand Down Expand Up @@ -300,9 +299,9 @@ data"

await slowFieldResolverInvoked.promise;
abortController.abort();
await expect(response$).rejects.toMatchInlineSnapshot(
jasonkuhrt marked this conversation as resolved.
Show resolved Hide resolved
`[AbortError: The operation was aborted]`,
);
const result = (await response$.catch(e => e)) as DOMException;
expect(result.message).toMatchInlineSnapshot(`"This operation was aborted"`);
expect(result instanceof DOMException).toBe(true);
await slowFieldResolverCanceled.promise;
} finally {
app.log.info = info;
Expand Down Expand Up @@ -349,9 +348,9 @@ data"
const next = await iterator.next();
expect(next.value).toEqual({ data: { countdown: 10 } });
abortController.abort();
await expect(iterator.next()).rejects.toMatchInlineSnapshot(
`[AbortError: The operation was aborted]`,
);
const result = (await iterator.next().catch(e => e)) as DOMException;
expect(result.message).toMatchInlineSnapshot(`"This operation was aborted"`);
expect(result instanceof DOMException).toBe(true);
await cancelationIsLoggedPromise.promise;
} finally {
app.log.info = info;
Expand Down
1 change: 0 additions & 1 deletion examples/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@whatwg-node/fetch": "^0.10.1",
"fastify": "5.1.0",
"graphql-yoga": "workspace:*",
"pino-pretty": "13.0.0"
Expand Down
22 changes: 18 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading