From 8cfd4ae8a69142a57679b6041827730cdcac6fcb Mon Sep 17 00:00:00 2001 From: Andrey Lunyov Date: Tue, 22 Aug 2023 17:49:48 -0700 Subject: [PATCH] RepoSync with changes to `commitMutation` and updates to product code to remove explicit type annotations and use typed `graphql` tags for mutations. (#2277) Summary: Pull Request resolved: https://github.com/facebookexperimental/Recoil/pull/2277 This is a RepoSync diff with changes to the product code: - Main change here is the updated `commitMutation` types that are using typed `graphql` tags. - Also this diff contains changes (mostly automated) to the product code that removes the explicit type annotations. See details on the codemod here: https://www.internalfb.com/intern/wiki/Relay-team/Flow_Integration/ - Additionally, this diff contain new $FlowFixMe in the places where new types uncovered issues with types. ---- Individual diffs for review: Product code changes: D48563977 FlowFixMe: D48563978 Reviewed By: captbaritone Differential Revision: D48543114 fbshipit-source-id: 7b34a622d00a55d2e721b81e837efe9db1281178 --- packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js b/packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js index 49f7d23e8..576466244 100644 --- a/packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js +++ b/packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js @@ -84,7 +84,7 @@ function graphQLMutationEffect< const mutationID = ++currentMutationID; const mutationVariables = variables(newValue); if (mutationVariables != null) { - commitMutation<$FlowFixMe>(environment, { + commitMutation(environment, { mutation, variables: mutationVariables, onError: error => { @@ -100,6 +100,8 @@ function graphQLMutationEffect< }, updater, optimisticUpdater, + /* $FlowFixMe[incompatible-call] error exposed when improving flow + * typing of commitMutation */ optimisticResponse: optimisticResponse?.(newValue), uploadables, });