Nullability is handled differently based on source for OpenApi swaggers
nathanbrachotte opened this issue · comments
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
The output for the exact same openApi Swagger definition (in yml) differs whether it is fetched from an endpoint or read locally by graphql-mesh
.
Basically afaics, this issue #2627 still occurs when fetching the swagger
To Reproduce Steps to reproduce the behavior:
I cannot provide a reproduction as our endpoints aren't public, and you need both a hosted and local version of the same file.
Sorry about that :/ Feel free to suggest a way I can help with that.
Expected behavior
Outputted schema to handle nullable: true
correctly when schema is fetched from a URL
type User {
id: String!
name: String!
imageUrl: String
}
But the result we get atm is:
type User {
id: String!
name: String!
imageUrl: String!
}
Environment:
- OS: MacOS 14.1.1 (23B81)
"@graphql-mesh/openapi": "^0.98.0"
:- NodeJS:
Additional context
I tried to curl the schema manually, then add the file locally and generate. I then got the expected result.
Thanks for creating the issue but if you help us to reproduce it, we can help you better.
Hey there, turns out the issue is somewhere else. Still investigating.
Closing the issue for now and I'll open a new one if I manage to identify where the issue is coming from.