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

Adding content-type header is not supported when fetching schema #5824

Open
4 tasks done
felamaslen opened this issue Jan 9, 2024 · 0 comments
Open
4 tasks done

Adding content-type header is not supported when fetching schema #5824

felamaslen opened this issue Jan 9, 2024 · 0 comments

Comments

@felamaslen
Copy link
Contributor

felamaslen commented Jan 9, 2024

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

To Reproduce Steps to reproduce the behavior:

  • Run graphql-codegen on a schema like the following:
schema:
  - https://my.schema/graphql:
      headers:
        content-type: 'application/vnd.api+json'
extensions:
  codegen:
    generates:
      'schema.graphql':
        plugins:
          - schema-ast
  • Observe that the request for introspection is made with header content-type: application/json, i.e. your config is not obeyed

Expected behavior

  • The request for introspection is made with the header content-type: application/vnd.api+json

Environment:

  • OS:
  • @graphql-tools/executor-http: 1.0.6
  • NodeJS:

Additional context

The bug is caused by this line: https://github.com/ardatan/graphql-tools/blob/master/packages/executors/http/src/index.ts#L204

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