Skip to content
Discussion options

You must be logged in to vote

Hi @davidkhierl,

it is not well documented, but the schema option of your codegen.yml can take an array of multiple schemas:

You can specify either a single schema or multiple, and GraphQL Code Generator will merge the schemas into a single schema.

The following would work:

schema:
  - http://localhost:3000/graphql:
      headers:
        Authorization: YOUR-TOKEN-HERE
  - http://localhost:3001/graphql:
      headers:
        Authorization: YOUR-TOKEN-HERE  

or

schema:
  - http://localhost:3000/graphql
  - http://localhost:3001/graphql

Also, schema can be specified both at the root level and output-file level: https://www.graphql-code-generator.com/docs/config-reference/schema-field#mul…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davidkhierl
Comment options

@davidkhierl
Comment options

@charlypoly
Comment options

Answer selected by davidkhierl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants