-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Mapped types are dropped when combined with unions at non-trivial depth. #5998
Comments
Hi @jacob-indieocean and thank you for the report! Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow. It seems already got into Now in order to advance to Thank you and sorry that this comment is not a complete solution (yet). |
Just thought I would add a little bit of context that I probably should have mentioned right from the start, for the sake of SEO and for the benefit of users struggling with a similar use case. I alluded to it in the names for the types in the schema, but to be more explicit, I'm running in to this issue while conforming to the Relay spec for connections, where the node type is a union. This is probably a fairly common use case and I am surprised it has not come up already. Actually, maybe you have seen it before. Is this a regression of #3979? |
Also bumped into this today! |
Bumping this again as we just ran into it. |
is anyone up to move this into stage 2 by creating a failing test? |
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Make sure to fork this template and run
yarn generate
in the terminal.Please make sure the Codegen and plugins version 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 resolver type for a type that contains a type that contains a union of types that are mapped, drops knowledge of the mapped type.
That a mouthful, but here is a minimal reproduction:
To Reproduce
LIve Code Sandbox: https://codesandbox.io/s/inspiring-shape-ts0t5
My GraphQL operations:
N/A
My
codegen.yml
config file:Expected behavior
The resolver type should be:
FeedConnection:ResolverTypeWrapper<Omit<FeedConnection, 'edge'> & { node?: Maybe<ResolversTypes['FeedEdge']> }>;
But the generated type is:
FeedConnection: ResolverTypeWrapper<FeedConnection>;
The text was updated successfully, but these errors were encountered: