Description
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 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