Skip to content

Commit

Permalink
RepoSync with changes to commitMutation and updates to product code…
Browse files Browse the repository at this point in the history
… to remove explicit type annotations and use typed `graphql` tags for mutations. (facebookexperimental#2277)

Summary:
Pull Request resolved: facebookexperimental#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
  • Loading branch information
alunyov authored and facebook-github-bot committed Aug 23, 2023
1 parent dba6c40 commit 8cfd4ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/recoil-relay/RecoilRelay_graphQLMutationEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -100,6 +100,8 @@ function graphQLMutationEffect<
},
updater,
optimisticUpdater,
/* $FlowFixMe[incompatible-call] error exposed when improving flow
* typing of commitMutation */
optimisticResponse: optimisticResponse?.(newValue),
uploadables,
});
Expand Down

0 comments on commit 8cfd4ae

Please sign in to comment.