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 - Overriding all Mutations to Queries results in invalid schema #4889

Closed
4 tasks
madorb opened this issue Dec 5, 2022 · 2 comments
Closed
4 tasks

Comments

@madorb
Copy link
Contributor

madorb commented Dec 5, 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

Attempting to override the classification of all operations from an OpenAPI handler from Mutation to Query results in an invalid schema - reports as Type Mutation must define one or more fields.

As long as there is at least one mutation left, this works as expected, but removing all mutations results in this error.

To Reproduce
Steps to reproduce the behavior:

Add an openapi handler that contains queries and mutations, and re-classify all mutations to queries e.g.

        selectQueryOrMutationField:
            - fieldName: 'searchLocation'
              type: Query

Expected behavior

Similar to #1474 the Mutation field should be removed if there are no mutations left after reclassification.

Environment:

  • OS: macos
  • @graphql-mesh/openapi: 0.33.39
  • NodeJS: 16.18.0

Additional context

@ardatan
Copy link
Owner

ardatan commented Dec 5, 2022

Please share a reproduction on CodeSandbox or StackBlitz! Thanks!

@ardatan
Copy link
Owner

ardatan commented Apr 3, 2023

Closing due to the missing reproduction. Feel free to create a new one with a reproduction if you still have the issue.

@ardatan ardatan closed this as completed Apr 3, 2023
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
Development

No branches or pull requests

2 participants