-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow client-side schema extensions in optimisticResponse
Summary: Setting client-side schema extension fields in `optimisticResponse` works fine, but `validateMutation` throws a warning. I've updated `validateMutation` to allow this. My use case is that I have an "is_saving" flag I'm adding to an object using "Client Schema Extensions". I want to set this flag when a mutation is being performed, and unset it when the mutation is complete. I want to display the state of the mutation in several places in the UI, and using local Relay state seemed like an easier way to do that compared to having to pass some React state through several components. Setting this field using `optimisticResponse` works well because Relay will automatically revert the change after the mutation is complete. Reviewed By: bennyhobart Differential Revision: D20228541 fbshipit-source-id: f9ed06739bc0155b29f3da2c28bc727324fc1a16
- Loading branch information
1 parent
aaa9588
commit b00736e
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters