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

Update usage-schema.md example #2274

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

hos
Copy link
Contributor

@hos hos commented Dec 7, 2024

Description

The documentation was using deprecated interfaces. With this update

  1. It uses new hookArgs, where you can pass resolvedPreset, requestContext with the args.
  2. It uses TypedDocumentNode from @graphql-typed-document-node/core, to support fully typed queries when using graphql-codegen's client-preset.

Note:

The return type of execute function is PromiseOrValue<ExecutionResult | AsyncGenerator<AsyncExecutionResult, void, undefined>>, but I didn't found AsyncExecutionResult so the type in the current example supports only ExecutionResult.

Performance impact

Security impact

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

@hos hos marked this pull request as ready for review December 7, 2024 16:25
@benjie benjie merged commit 9743943 into graphile:main Dec 9, 2024
21 checks passed
@benjie
Copy link
Member

benjie commented Dec 9, 2024

Thanks! I extracted the refactor from makeSchema() to postgraphile() into #2275, and then re-implemented the TypedDocumentNode example via a separate PR #2277 - let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants