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

openapi handler: Unable to set Accept header in operationHeaders #4408

Closed
4 tasks
cwlim opened this issue Aug 31, 2022 · 0 comments · Fixed by #4419
Closed
4 tasks

openapi handler: Unable to set Accept header in operationHeaders #4408

cwlim opened this issue Aug 31, 2022 · 0 comments · Fixed by #4419

Comments

@cwlim
Copy link

cwlim commented Aug 31, 2022

Issue workflow progress

Progress of the issue based on the Contributor Workflow

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

Please make sure Mesh 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

Unable to set Accept header in operationHeaders when using openapi handler. I have a requirement to pass version number in Accept for example application/json;v=2 to call the right version of the API. However, it is always reverted back to application/json.

To Reproduce
.meshrc.yml

sources:
  - name: Orbit
    handler:
      openapi:
        source: https://app.orbit.love/api-docs/v1/swagger.json
        operationHeaders:
            Accept: application/json;v=2
customFetch: ./custom-fetch.ts

custom-fetch.ts

const fetch = require('node-fetch')
export default (url, options) => {
   console.table(options);
   return fetch(url, options)
}

Expected behavior

Allow Accept header

Environment:

  • OS: MacOS 12.5
  • @graphql-mesh/...:
  • NodeJS: Node 16

Additional context

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 a pull request may close this issue.

1 participant