relay icon indicating copy to clipboard operation
relay copied to clipboard

Fix raw response with selections on abstract type

Open tobias-tengler opened this issue 1 year ago • 6 comments

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 avatar Aug 20 '24 19:08 tobias-tengler

@captbaritone Thoughts on this?

tobias-tengler avatar Sep 06 '24 08:09 tobias-tengler

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.

captbaritone avatar Sep 06 '24 17:09 captbaritone

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

tobias-tengler avatar Sep 17 '24 19:09 tobias-tengler

@captbaritone Could we land this?

tobias-tengler avatar Jan 21 '25 18:01 tobias-tengler

@captbaritone Thanks for the review! One more question: Do you need a feature flag to turn of this addition at Meta? I just added one because I thought it's the kind of change you guys would want to have a flag for, but if you don't, I'll gladly get rid of it 😆

tobias-tengler avatar Jan 22 '25 18:01 tobias-tengler

Do you need a feature flag to turn of this addition at Meta?

I suspect we will.

captbaritone avatar Jan 23 '25 22:01 captbaritone