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

loadSchema function cannot accept array of pointers in Typescript declaration files #10196

Open
Nnigmat opened this issue Nov 20, 2024 · 0 comments

Comments

@Nnigmat
Copy link

Nnigmat commented Nov 20, 2024

Which packages are impacted by your issue?

@graphql-codegen/cli

Describe the bug

Function loadSchema should support array of pointers as an argument. The function support this behaviour, but the types are not.

schemaPointers: UnnormalizedTypeDefPointer,

The same problem in method loadSchema in CodegenContext class. It should be Types.Schema[].

async loadSchema(pointer: Types.Schema): Promise<GraphQLSchema> {

loadSchema from @graphql-tools/load supports array of pointers too.

https://github.com/ardatan/graphql-tools/blob/66b6a98d7e134e932f28e7788b4884d2c0461b12/packages/load/src/schema.ts#L45

Your Example Website or App

Steps to Reproduce the Bug or Issue

loadSchema(['src/schema-1.graphql', 'src/schema-2.graphql'] shows error

Expected behavior

loadSchema(['src/schema-1.graphql', 'src/schema-2.graphql'] don't show error

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • NodeJS: [e.g. 18.5.0]
  • graphql version: [e.g. 16.3.0]
  • @graphql-codegen/* version(s): [e.g. 2.6.2]

Codegen Config File

No response

Additional context

No response

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

No branches or pull requests

1 participant