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

[v1] Undesired output from PR #4419 #4460

Closed
4 tasks
cwlim opened this issue Sep 9, 2022 · 1 comment · Fixed by #6910 or #6913
Closed
4 tasks

[v1] Undesired output from PR #4419 #4460

cwlim opened this issue Sep 9, 2022 · 1 comment · Fixed by #6910 or #6913

Comments

@cwlim
Copy link

cwlim commented Sep 9, 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

#4408 Request to allow setting Accept in operationHeader
#4419 Allow user to set Accept header from schema.

The fix introduces a side effect which generates schema with JSON types if accept header is set. The desire outcome is to allow accept header in operationHeader as such "application/json;v=2" without impacting the generated schema.graphql. It is the convention in the company to invoke the right version of the API.

Here is an article about using Accept header to indicate version of the web API: https://dotnettutorials.net/lesson/web-api-versioning-using-accept-header.

To Reproduce
Steps to reproduce the behavior:

  1. Using examples/openapi-orbit:
sources:
  - name: Orbit
    handler:
      openapi:
        source: https://app.orbit.love/api-docs/v1/swagger.json
        operationHeaders:
          accept: application/json;v=2
  1. run npm run build
  2. inspect .mesh/schema.graphql

Expected behavior

  1. The value of operationHeaders including accept header should be retained and set as header when invoking underlying API.
  2. The generated schema should not have JSON type for all fields when Accept header is set as application/json;v=33.

Environment:

  • OS: MacOS Monterey
"@graphql-mesh/cli": "^0.78.2"
"@graphql-mesh/openapi": "^0.33.7"
"@graphql": "^16.6.0"
  • NodeJS: 16.30.0

Additional context

@Urigo Urigo mentioned this issue Sep 15, 2022
55 tasks
@gilgardosh gilgardosh changed the title Undesired output from PR #4419 [v1] Undesired output from PR #4419 Oct 2, 2023
@theguild-bot theguild-bot mentioned this issue Oct 2, 2023
@ardatan
Copy link
Owner

ardatan commented Apr 29, 2024

Fixed by #6910
Sorry for the late response!
If the issue persists, please let us know

This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants