facebook / relay

Relay is a JavaScript framework for building data-driven React applications.
https://relay.dev
MIT License
18.38k stars 1.82k forks source link

Fix conditional sub-selections in raw response type #4774

Open tobias-tengler opened 1 month ago

tobias-tengler commented 1 month ago

Previously conditional selections were always generated as required properties, which is inconvenient if your component code checks for the presence of a field and you can't model the skipped state in a test using @raw_response_type without partially disabling type checking.

This PR makes all conditional selections optional in the raw response type.

tobias-tengler commented 1 month ago

The test failure in the ubuntu job seems to be unrelated / transient, but I can't trigger another run.

EDIT: This also happens on main, so it's not the fault of my changes.

facebook-github-bot commented 1 month ago

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

tobias-tengler commented 1 week ago

@captbaritone Fixed the merge conflicts on this one.