-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix load schema pointer type #10227
base: master
Are you sure you want to change the base?
Fix load schema pointer type #10227
Conversation
🦋 Changeset detectedLatest commit: 5558de2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-codegen/cli |
5.0.4-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
5.6.1-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
4.0.13-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
4.0.13-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
4.4.1-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
4.4.2-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
5.0.13-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
4.1.3-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
4.6.0-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
4.0.13-alpha-20250126103404-5558de2d7331f3bb08ce6e7aac9aa1678959cb8c |
npm ↗︎ unpkg ↗︎ |
@@ -28,7 +28,7 @@ export const defaultDocumentsLoadOptions = { | |||
}; | |||
|
|||
export async function loadSchema( | |||
schemaPointers: UnnormalizedTypeDefPointer, | |||
schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add tests for this use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! This is done in 9efc60b
Note that instead of testing this load.ts
directly, I'm passing multiple schemas into Codegen Context which eventually passes those schemas to load.ts
💻 Website PreviewThe latest changes are available as preview in: https://e487a17f.graphql-code-generator.pages.dev |
66ea8b9
to
6ee50e4
Compare
Description
This fixes a type issue in functions used in programmatic scenarios which have the wrong type for schema param. We can take a single schema or an array. This PR adds the array part to it
Related # #10196
Type of change
How Has This Been Tested?