Skip to content

Commit 3330731

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Make variables prop in commitMutation param NoInfer to improve errors
Reviewed By: panagosg7 Differential Revision: D77458796 fbshipit-source-id: 0339b5d2769c7aca633c0309ce558c4340d370c6
1 parent 9c42f72 commit 3330731

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

packages/relay-runtime/mutations/__tests__/commitMutation-test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ describe('Configs: NODE_DELETE', () => {
145145
store.subscribe(snapshot, callback);
146146
commitMutation(environment, {
147147
configs,
148-
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
149-
* commitMutation */
150148
mutation,
151149
optimisticResponse,
152150
optimisticUpdater,
153151
updater,
152+
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
153+
* commitMutation */
154154
variables,
155155
});
156156
expect(callback.mock.calls.length).toBe(1);
@@ -598,14 +598,14 @@ describe('Configs: RANGE_ADD', () => {
598598
store.subscribe(snapshot, callback);
599599
commitMutation(environment, {
600600
configs,
601-
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
602-
* commitMutation */
603-
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
604-
* of commitMutation */
605601
mutation,
606602
optimisticResponse,
607603
optimisticUpdater,
608604
updater,
605+
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
606+
* commitMutation */
607+
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
608+
* of commitMutation */
609609
variables,
610610
});
611611
// Optimistically appends
@@ -658,11 +658,11 @@ describe('Configs: RANGE_ADD', () => {
658658
// send mutation
659659
commitMutation(environment, {
660660
configs,
661+
mutation,
661662
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
662663
* commitMutation */
663664
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
664665
* of commitMutation */
665-
mutation,
666666
variables,
667667
});
668668
@@ -747,11 +747,11 @@ describe('Configs: RANGE_ADD', () => {
747747
// send the same mutation again
748748
commitMutation(environment, {
749749
configs,
750+
mutation,
750751
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
751752
* commitMutation */
752753
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
753754
* of commitMutation */
754-
mutation,
755755
variables,
756756
});
757757
environment.mock.resolve(operation, serverResponse);
@@ -831,14 +831,14 @@ describe('Configs: RANGE_ADD', () => {
831831
store.subscribe(snapshot, callback);
832832
commitMutation(environment, {
833833
configs,
834-
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
835-
* commitMutation */
836-
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
837-
* of commitMutation */
838834
mutation,
839835
optimisticResponse,
840836
optimisticUpdater,
841837
updater,
838+
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
839+
* commitMutation */
840+
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
841+
* of commitMutation */
842842
variables,
843843
});
844844
// Optimistically prepends
@@ -900,14 +900,14 @@ describe('Configs: RANGE_ADD', () => {
900900
store.subscribe(snapshot, callback);
901901
commitMutation(environment, {
902902
configs,
903-
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
904-
* commitMutation */
905-
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
906-
* of commitMutation */
907903
mutation,
908904
optimisticResponse,
909905
optimisticUpdater,
910906
updater,
907+
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
908+
* commitMutation */
909+
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
910+
* of commitMutation */
911911
variables,
912912
});
913913
// Optimistically appends orderBy(chronological)
@@ -959,11 +959,11 @@ describe('Configs: RANGE_ADD', () => {
959959
// send mutation
960960
commitMutation(environment, {
961961
updater,
962+
mutation,
962963
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
963964
* commitMutation */
964965
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
965966
* of commitMutation */
966-
mutation,
967967
variables,
968968
});
969969
@@ -1054,11 +1054,11 @@ describe('Configs: RANGE_ADD', () => {
10541054
// send the same mutation again
10551055
commitMutation(environment, {
10561056
updater,
1057+
mutation,
10571058
/* $FlowFixMe[prop-missing] error exposed when improving flow typing of
10581059
* commitMutation */
10591060
/* $FlowFixMe[incompatible-call] error exposed when improving flow typing
10601061
* of commitMutation */
1061-
mutation,
10621062
variables,
10631063
});
10641064
environment.mock.resolve(operation, serverResponse);

packages/relay-runtime/mutations/commitMutation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export type CommitMutationConfig<TVariables, TData, TRawResponse> = $ReadOnly<{
7171
optimisticUpdater?: ?SelectorStoreUpdater<TData>,
7272
updater?: ?SelectorStoreUpdater<TData>,
7373
uploadables?: UploadableMap,
74-
variables: TVariables,
74+
variables: NoInfer<TVariables>,
7575
}>;
7676

7777
/**

0 commit comments

Comments
 (0)