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
Possible to remove Maybe & Scalars types in favor of number | null
and inlined Scalar values?
#2048
Comments
Hi @ericbiewener , we are already thinking about adding this feature. |
Same here, is the Maybe type removed or at least configurable! Let's suppose I'm developing a Service Layer that handles the service layer communication and all I want are types to type my queries or mutation. Here's a case where I'm typing my state depending on query's result. type TopicsState = {
suggestedTopics: Maybe<DisplaySuggestedTopic>[] | null | undefined;
}; |
Is this still in the cards, or perhaps already implemented? If not, is it doable for me to create a plugin to achieve this? @dotansimha is #1904 really the same problem? Seems like it was dealt with but this one remains |
I looked at #2107, and it doesn't seem to resolve the originally asked question. Ideally, I'd like for the generated type files to just inline Maybe whenever possible. For example, currently the behavior is:
But, I'd really like to ability to simply generate:
Is there some trade-off here between the two that I don't understand? |
@adamtaylor13 Did you find any solution? |
@ryancarloscorrea Unfortunately not |
I would like the same as @adamtaylor13 the readability of the types is more confusing for others on our team and simply inlining the types (as though I was writing them by hand) would be the ideal. I could hack it with some regexp find/replace but would rather have an option for this! What is the advantage to having the extra scalars layer? |
Hi! no news regarding it? Types are quite ugly. |
Yea it would be pretty good to have config to remove this. Really annoying and forcing me to cast types when doing transforms, |
Rather than the creation of
type Maybe<T> = T | null
, is it possible to just inline the| null
everywhere it is used? Same with thetype Scalars
. To clarify:Current output:
Desired output:
I'd also be interested to know if there is an advantage to the current approach.
The text was updated successfully, but these errors were encountered: