You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The issue provides a reproduction available on CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Description
Mesh wrongly think additionalTypeDefs is a path on syntax error.
Mesh try to recognize if the string passed in the additionalTypeDefs is an entire document or a path to document.
For this, it just tries to parse it and assert that it's a path if it fails, silently discarding parsing errors.
This leads to not so easy debug experience when you made a syntax error in your schema extension.
While we should perhaps emphasising that using a separate file is recommended, we should also provide a correct error reporting for every way of using the tool.
Bug reproduction
Try to start mesh with following config:
sources:
- name: Hello Worldhandler:
jsonSchema:
operations:
- type: Queryfield: greetingmethod: GETpath: /responseSample: greeting.jsonadditionalTypeDefs: | extend Query { id = Int # This is a syntax error }
Expected behaviour
It should show the parsing error instead of a "file not found" kind of error.
The text was updated successfully, but these errors were encountered:
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Description
Mesh wrongly think
additionalTypeDefs
is a path on syntax error.Mesh try to recognize if the string passed in the
additionalTypeDefs
is an entire document or a path to document.For this, it just tries to parse it and assert that it's a path if it fails, silently discarding parsing errors.
This leads to not so easy debug experience when you made a syntax error in your schema extension.
While we should perhaps emphasising that using a separate file is recommended, we should also provide a correct error reporting for every way of using the tool.
Bug reproduction
Try to start mesh with following config:
Expected behaviour
It should show the parsing error instead of a "file not found" kind of error.
The text was updated successfully, but these errors were encountered: