Skip to content

Commit

Permalink
Fix load schema pointer type
Browse files Browse the repository at this point in the history
  • Loading branch information
eddeee888 committed Jan 18, 2025
1 parent 60dd72f commit 6ee50e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-spiders-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

Fix schema pointers type to allow an array of pointers
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class CodegenContext {
return this._pluginContext;
}

async loadSchema(pointer: Types.Schema): Promise<GraphQLSchema> {
async loadSchema(pointer: Types.Schema | Types.Schema[]): Promise<GraphQLSchema> {
const config = this.getConfig(defaultSchemaLoadOptions);
if (this._graphqlConfig) {
// TODO: SchemaWithLoader won't work here
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const defaultDocumentsLoadOptions = {
};

export async function loadSchema(
schemaPointers: UnnormalizedTypeDefPointer,
schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[],
config: Types.Config
): Promise<GraphQLSchema> {
try {
Expand Down

0 comments on commit 6ee50e4

Please sign in to comment.