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

Fix load schema pointer type #10227

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix load schema pointer type #10227

wants to merge 3 commits into from

Conversation

eddeee888
Copy link
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit test

Copy link

changeset-bot bot commented Jan 3, 2025

🦋 Changeset detected

Latest commit: 5558de2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/cli Patch

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

Copy link
Contributor

github-actions bot commented Jan 3, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

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[],
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Copy link
Contributor

github-actions bot commented Jan 3, 2025

💻 Website Preview

The latest changes are available as preview in: https://e487a17f.graphql-code-generator.pages.dev

@eddeee888 eddeee888 requested a review from ardatan January 18, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants