Skip to content
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

Fix raw response with selections on abstract type #4775

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tobias-tengler
Copy link
Contributor

@tobias-tengler tobias-tengler commented Aug 20, 2024

Previously all selections done on abstract types, would be generated as required properties in the raw response type.
This PR tracks all selections on abstract types separately and only makes them required if the concrete type implements the abstract type. The change in the generated types can be seen in this diff.

To enable a gradual rollout, a disable_more_precise_abstract_selection_raw_response_type feature flag has been added that allows to opt operations out of the new raw response type generation.

@tobias-tengler tobias-tengler force-pushed the fix-raw-response-with-selections-on-abstract-type branch from b883382 to 32f5717 Compare September 6, 2024 08:04
@tobias-tengler
Copy link
Contributor Author

@captbaritone Thoughts on this?

@captbaritone
Copy link
Contributor

This looks more correct to me at first glance! Thanks for working on this. I likely won't have time to look into it more closely until after GraphQL conf. One thing we'll have to look out for is if this will cause type errors with existing places people are using raw response types and how we'll manage that rollout if it's the case.

Let me see if anyone else on the team can take a look before then.

@tobias-tengler tobias-tengler force-pushed the fix-raw-response-with-selections-on-abstract-type branch 2 times, most recently from b2a047c to 97221cb Compare September 17, 2024 19:04
@tobias-tengler
Copy link
Contributor Author

@captbaritone This will certainly lead to type errors for existing projects. I've added a feature flag to enable an opt-out.

@tobias-tengler tobias-tengler force-pushed the fix-raw-response-with-selections-on-abstract-type branch from 97221cb to 45b2e04 Compare September 20, 2024 19:07
@tobias-tengler tobias-tengler force-pushed the fix-raw-response-with-selections-on-abstract-type branch from 45b2e04 to 2be6f8c Compare October 15, 2024 18:15
@tobias-tengler tobias-tengler force-pushed the fix-raw-response-with-selections-on-abstract-type branch from 2be6f8c to af3c1c4 Compare October 20, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants