From f40026595fb912edb3e4fe3c215b3fd5ae802fd9 Mon Sep 17 00:00:00 2001 From: Andrey Lunyov Date: Wed, 23 Aug 2023 08:53:29 -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: 73efd4a93975b4da97e2c5eb673a4fe896f3ab0c --- 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, });