Optional variables generate with InputMaybe instead of Maybe #8082
Unanswered
lockykeaney
asked this question in
Q&A
Replies: 1 comment
-
@lockykeaney Did you manage to resolve this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this front end query that takes in 2 potential values, but both are optional as they will be resolved on the back end:
When the generator runs through the schema (which is an external document that I get from a backend that I don't maintain), it creates a type
Maybe
, but the query variables type in thegenerated.ts
file is trying to useTypes.InputMaybe<>
which does not exist in the schema file:From what I can find around other issues and posts,
InputMaybe
is use define when an input can be optional, whereasMaybe
is for the optional outputs.I tried adding it as global type that copied the generated one), which stopped the VS code warning but still can't build.
Is there a config setting for the YAML file I need to add so I can force that type to generate?
I have tried adding
from this issue reply but they also look to be the default values from the plugin anyway, which leads me to think that there is a config setting where I have to enable the generation of the
InputMaybe
type. Or is it something that comes from the schema and can't be generated without it?The current project I'm working on is quite large and proprietary, so I can't share big chucks of code and information. I don't feel like it would be a library issue, but an edge case for my particular use, so I only need to understand what is trying to happen in the generation and why.
Beta Was this translation helpful? Give feedback.
All reactions