From 8ee0ee7c03aeeb08fd9489d524911f61280abce4 Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Sun, 3 Jul 2016 21:21:16 +0300 Subject: [PATCH 1/6] Pass call type in from/toGraphQL Currently types are ignored and not getting passed in `callsFromGraphQL` or `callsToGraphQL`. This results in dangerous output in `toGraphQL`, in which all calls have type null. This can cause problems when using non-scalar types (like enum). Example can be found [here](https://github.com/facebook/relay/issues/1256). --- src/query/callsFromGraphQL.js | 4 +++- src/query/callsToGraphQL.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/query/callsFromGraphQL.js b/src/query/callsFromGraphQL.js index a175260a49fab..73aaaadac51cd 100644 --- a/src/query/callsFromGraphQL.js +++ b/src/query/callsFromGraphQL.js @@ -26,6 +26,7 @@ const invariant = require('invariant'); type CallOrDirective = { name: string, value: ?ConcreteValue, + type?: ?string, }; /** @@ -43,6 +44,7 @@ function callsFromGraphQL( for (let ii = 0; ii < callsOrDirectives.length; ii++) { const callOrDirective = callsOrDirectives[ii]; let {value} = callOrDirective; + let {type} = callOrDirective.metadata; if (value != null) { if (Array.isArray(value)) { value = value.map(arg => getCallValue(arg, variables)); @@ -53,7 +55,7 @@ function callsFromGraphQL( value = getCallValue(value, variables); } } - orderedCalls.push({name: callOrDirective.name, value}); + orderedCalls.push({name: callOrDirective.name, value, type}); } return orderedCalls; } diff --git a/src/query/callsToGraphQL.js b/src/query/callsToGraphQL.js index e029d24884588..2c331812cf91f 100644 --- a/src/query/callsToGraphQL.js +++ b/src/query/callsToGraphQL.js @@ -22,14 +22,14 @@ const QueryBuilder = require('QueryBuilder'); * Convert from plain object `{name, value}` calls to GraphQL call nodes. */ function callsToGraphQL(calls: Array): Array { - return calls.map(({name, value}) => { + return calls.map(({name, value, type}) => { let concreteValue = null; if (Array.isArray(value)) { concreteValue = value.map(QueryBuilder.createCallValue); } else if (value != null) { concreteValue = QueryBuilder.createCallValue(value); } - return QueryBuilder.createCall(name, concreteValue); + return QueryBuilder.createCall(name, concreteValue, type); }); } From 635245e436f333c0ce1582fb858bb5667082c585 Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Sun, 3 Jul 2016 21:42:08 +0300 Subject: [PATCH 2/6] Not getting type from directives --- src/query/callsFromGraphQL.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/query/callsFromGraphQL.js b/src/query/callsFromGraphQL.js index 73aaaadac51cd..5800930fe739b 100644 --- a/src/query/callsFromGraphQL.js +++ b/src/query/callsFromGraphQL.js @@ -43,8 +43,11 @@ function callsFromGraphQL( const orderedCalls = []; for (let ii = 0; ii < callsOrDirectives.length; ii++) { const callOrDirective = callsOrDirectives[ii]; - let {value} = callOrDirective; - let {type} = callOrDirective.metadata; + let {value, metadata} = callOrDirective; + let type = undefined; + if (metadata){ + type = metadata.type; + } if (value != null) { if (Array.isArray(value)) { value = value.map(arg => getCallValue(arg, variables)); From 53749db1a36c01e98aa4590b13967eb688813b25 Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Mon, 4 Jul 2016 00:27:54 +0300 Subject: [PATCH 3/6] tests --- .../__tests__/RelayQuery-getCallsWithValues-test.js | 13 +++++++++++++ src/query/__tests__/RelayQuery-test.js | 7 ++++--- src/query/__tests__/RelayQueryField-test.js | 4 ++-- src/query/__tests__/RelayQueryRoot-test.js | 2 +- src/query/__tests__/callsToGraphQL-test.js | 4 ++++ src/query/callsFromGraphQL.js | 10 +++++++--- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/query/__tests__/RelayQuery-getCallsWithValues-test.js b/src/query/__tests__/RelayQuery-getCallsWithValues-test.js index b4e7979450545..ae6a893e5b2ad 100644 --- a/src/query/__tests__/RelayQuery-getCallsWithValues-test.js +++ b/src/query/__tests__/RelayQuery-getCallsWithValues-test.js @@ -36,6 +36,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: null, + type: null, }]); }); @@ -44,6 +45,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: 32, + type: null, }]); }); }); @@ -56,6 +58,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: null, + type: null, }]); }); @@ -66,6 +69,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [], + type: null, }]); }); @@ -76,6 +80,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: 32, + type: null, }]); }); @@ -86,6 +91,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [32], + type: null, }]); }); }); @@ -98,6 +104,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [], + type: null, }]); }); @@ -108,6 +115,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [64], + type: null, }]); }); }); @@ -121,6 +129,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [null], + type: null, }]); }); @@ -132,6 +141,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [[]], + type: null, }]); }); @@ -143,6 +153,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [32], + type: null, }]); }); @@ -154,6 +165,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [[32]], + type: null, }]); }); @@ -168,6 +180,7 @@ describe('RelayQueryNode.prototype.getCallsWithValues()', function() { expect(field.getCallsWithValues()).toEqual([{ name: 'size', value: [32, 64], + type: null, }]); }); }); diff --git a/src/query/__tests__/RelayQuery-test.js b/src/query/__tests__/RelayQuery-test.js index f40c9b49d1672..ae37bde5ffee5 100644 --- a/src/query/__tests__/RelayQuery-test.js +++ b/src/query/__tests__/RelayQuery-test.js @@ -100,7 +100,7 @@ describe('RelayQuery', () => { {identifyingArgName: 'id'} ); expect(root.getCallsWithValues()).toEqual([ - {name: 'id', value: '123'}, + {name: 'id', value: '123', type: null}, ]); }); @@ -138,6 +138,7 @@ describe('RelayQuery', () => { expect(root.getIdentifyingArg()).toEqual({ name: 'id', value: '123', + type: null, }); }); @@ -377,7 +378,7 @@ describe('RelayQuery', () => { expect(mutation.getChildren().length).toBe(1); expect(mutation.getChildren()[0]).toBe(field); expect(mutation.getCall()) - .toEqual({name: 'feedback_like', value: {feedback_id:'123'}}); + .toEqual({name: 'feedback_like', value: {feedback_id:'123'}, type: null}); expect(mutation.getCallVariableName()).toEqual('input'); expect(mutation.getRoute().name).toBe('FooRoute'); }); @@ -401,7 +402,7 @@ describe('RelayQuery', () => { expect(mutation.getChildren().length).toBe(1); expect(mutation.getChildren()[0]).toBe(field); expect(mutation.getCall()) - .toEqual({name: 'feedback_like', value: ''}); + .toEqual({name: 'feedback_like', value: '', type: null}); expect(mutation.getCallVariableName()).toEqual('input'); }); }); diff --git a/src/query/__tests__/RelayQueryField-test.js b/src/query/__tests__/RelayQueryField-test.js index 40c752a6d8c75..8df9fb3b514cb 100644 --- a/src/query/__tests__/RelayQueryField-test.js +++ b/src/query/__tests__/RelayQueryField-test.js @@ -685,8 +685,8 @@ describe('RelayQueryField', () => { clonedFeed = friendsVariableField.cloneFieldWithCalls( friendsVariableField.getChildren(), [ - {name: 'first', value: 10}, - {name: 'after', value: 'offset'}, + {name: 'first', value: 10, type: null}, + {name: 'after', value: 'offset', type: null}, ] ); expect(clonedFeed).toBe(friendsVariableField); diff --git a/src/query/__tests__/RelayQueryRoot-test.js b/src/query/__tests__/RelayQueryRoot-test.js index fa1e2c0bd9007..b9e48a4748455 100644 --- a/src/query/__tests__/RelayQueryRoot-test.js +++ b/src/query/__tests__/RelayQueryRoot-test.js @@ -159,7 +159,7 @@ describe('RelayQueryRoot', () => { expect(me.getIdentifyingArg()).toEqual(undefined); expect(usernames.getIdentifyingArg()).toEqual( - {name: 'names', value: 'mroch'} + {name: 'names', value: 'mroch', type: '[String!]!'} ); expect(getNode(Relay.QL` diff --git a/src/query/__tests__/callsToGraphQL-test.js b/src/query/__tests__/callsToGraphQL-test.js index bb047d14b7469..27fca6f9d4b36 100644 --- a/src/query/__tests__/callsToGraphQL-test.js +++ b/src/query/__tests__/callsToGraphQL-test.js @@ -23,6 +23,7 @@ describe('callsToGraphQL', function() { const relayCalls = [{ name: 'size', value: null, + type: null, }]; const graphqlCalls = [RelayTestUtils.createCall('size', null)]; expect(callsFromGraphQL(graphqlCalls)).toEqual(relayCalls); @@ -33,6 +34,7 @@ describe('callsToGraphQL', function() { const relayCalls = [{ name: 'size', value: [], + type: null, }]; const graphqlCalls = [RelayTestUtils.createCall('size', [])]; expect(callsFromGraphQL(graphqlCalls)).toEqual(relayCalls); @@ -43,6 +45,7 @@ describe('callsToGraphQL', function() { const relayCalls = [{ name: 'size', value: [32, 64], + type: null, }]; const graphqlCalls = [RelayTestUtils.createCall('size', [32, 64])]; expect(callsFromGraphQL(graphqlCalls)).toEqual(relayCalls); @@ -53,6 +56,7 @@ describe('callsToGraphQL', function() { const relayCalls = [{ name: 'size', value: 32, + type: null, }]; const graphqlCalls = [RelayTestUtils.createCall('size', 32)]; expect(callsFromGraphQL(graphqlCalls)).toEqual(relayCalls); diff --git a/src/query/callsFromGraphQL.js b/src/query/callsFromGraphQL.js index 5800930fe739b..38a265406e60d 100644 --- a/src/query/callsFromGraphQL.js +++ b/src/query/callsFromGraphQL.js @@ -23,10 +23,14 @@ import type {Variables} from 'RelayTypes'; const invariant = require('invariant'); +type Metadata = { + type: ?string, +}; + type CallOrDirective = { name: string, value: ?ConcreteValue, - type?: ?string, + metadata: ?Metadata, }; /** @@ -44,8 +48,8 @@ function callsFromGraphQL( for (let ii = 0; ii < callsOrDirectives.length; ii++) { const callOrDirective = callsOrDirectives[ii]; let {value, metadata} = callOrDirective; - let type = undefined; - if (metadata){ + let type?: string; + if (metadata && metadata.type){ type = metadata.type; } if (value != null) { From 13798e0033a8ff1e45d7a59b94358d8a5a5da78a Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Mon, 4 Jul 2016 00:32:10 +0300 Subject: [PATCH 4/6] tests --- src/query/callsFromGraphQL.js | 2 +- src/tools/RelayInternalTypes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/query/callsFromGraphQL.js b/src/query/callsFromGraphQL.js index 38a265406e60d..3f8859cc5bc50 100644 --- a/src/query/callsFromGraphQL.js +++ b/src/query/callsFromGraphQL.js @@ -48,7 +48,7 @@ function callsFromGraphQL( for (let ii = 0; ii < callsOrDirectives.length; ii++) { const callOrDirective = callsOrDirectives[ii]; let {value, metadata} = callOrDirective; - let type?: string; + let type: ?string; if (metadata && metadata.type){ type = metadata.type; } diff --git a/src/tools/RelayInternalTypes.js b/src/tools/RelayInternalTypes.js index cd669bf4e21ee..c970e60d0b629 100644 --- a/src/tools/RelayInternalTypes.js +++ b/src/tools/RelayInternalTypes.js @@ -23,7 +23,7 @@ import type RelayQuery from 'RelayQuery'; export type Call = { name: string, - type?: string, + type?: ?string, value: CallValue, }; export type CallValue = ?( From 74c528adbd0704282070aac2d1620f858e37d863 Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Mon, 4 Jul 2016 00:43:15 +0300 Subject: [PATCH 5/6] tests --- src/query/callsFromGraphQL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query/callsFromGraphQL.js b/src/query/callsFromGraphQL.js index 3f8859cc5bc50..437596d11bc6c 100644 --- a/src/query/callsFromGraphQL.js +++ b/src/query/callsFromGraphQL.js @@ -48,7 +48,7 @@ function callsFromGraphQL( for (let ii = 0; ii < callsOrDirectives.length; ii++) { const callOrDirective = callsOrDirectives[ii]; let {value, metadata} = callOrDirective; - let type: ?string; + let type: ?string = null; if (metadata && metadata.type){ type = metadata.type; } From e65e4d57eca5b111dd99829e5ee02ecf31abc920 Mon Sep 17 00:00:00 2001 From: Gershon Papiashvili Date: Mon, 4 Jul 2016 01:05:04 +0300 Subject: [PATCH 6/6] tests --- .../transformPayloadToRelayGraphMode-test.js | 2 +- src/query/__tests__/RelayQuery-test.js | 10 ++++---- src/query/__tests__/RelayQueryField-test.js | 25 +++++++++++-------- .../__tests__/RelayQueryFragment-test.js | 2 +- .../__tests__/RelayQueryMutation-test.js | 1 + src/query/__tests__/RelayQueryRoot-test.js | 2 +- src/query/__tests__/buildRQL-test.js | 2 +- src/query/__tests__/createRelayQuery-test.js | 2 +- 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/graphmode/__tests__/transformPayloadToRelayGraphMode-test.js b/src/graphmode/__tests__/transformPayloadToRelayGraphMode-test.js index e5c19870f4397..32959708ac708 100644 --- a/src/graphmode/__tests__/transformPayloadToRelayGraphMode-test.js +++ b/src/graphmode/__tests__/transformPayloadToRelayGraphMode-test.js @@ -296,7 +296,7 @@ describe('transformPayloadToRelayGraphMode()', () => { }, { op: 'putEdges', - args: [{name: 'first', value: '1'}, {name: 'orderby', value: 'date'}], + args: [{name: 'first', value: '1', type: null}, {name: 'orderby', value: 'date', type: null}], edges: [ { __typename: 'CommentsEdge', diff --git a/src/query/__tests__/RelayQuery-test.js b/src/query/__tests__/RelayQuery-test.js index ae37bde5ffee5..cc7b010036f8e 100644 --- a/src/query/__tests__/RelayQuery-test.js +++ b/src/query/__tests__/RelayQuery-test.js @@ -309,7 +309,7 @@ describe('RelayQuery', () => { type: 'ProfilePicture', }); expect(field.getCallsWithValues()).toEqual([ - {name: 'size', value: 32}, + {name: 'size', value: 32, type: null}, ]); field = RelayQuery.Field.build({ fieldName: 'profilePicture', @@ -320,7 +320,7 @@ describe('RelayQuery', () => { type: 'ProfilePicture', }); expect(field.getCallsWithValues()).toEqual([ - {name: 'size', value: ['32']}, + {name: 'size', value: ['32'], type: null}, ]); }); @@ -337,7 +337,7 @@ describe('RelayQuery', () => { type: 'ProfilePicture', }); expect(field.getDirectives()).toEqual([{ - args: [{name: 'bar', value: 'baz'}], + args: [{name: 'bar', value: 'baz', type: null}], name: 'foo', }]); }); @@ -484,7 +484,7 @@ describe('RelayQuery', () => { expect(grandchildren[0].getSchemaName()).toBe('id'); expect(grandchildren[1].getSchemaName()).toBe('profilePicture'); expect(grandchildren[1].getCallsWithValues()).toEqual([ - {name: 'size', value: 'override'}, + {name: 'size', value: 'override', type: null}, ]); }); @@ -534,7 +534,7 @@ describe('RelayQuery', () => { expect(grandchildren[0].getSchemaName()).toBe('id'); expect(grandchildren[1].getSchemaName()).toBe('profilePicture'); expect(grandchildren[1].getCallsWithValues()).toEqual([ - {name: 'size', value: 'override'}, + {name: 'size', value: 'override', type: null}, ]); expect(children[2] instanceof RelayQuery.Fragment); diff --git a/src/query/__tests__/RelayQueryField-test.js b/src/query/__tests__/RelayQueryField-test.js index 8df9fb3b514cb..430916357c998 100644 --- a/src/query/__tests__/RelayQueryField-test.js +++ b/src/query/__tests__/RelayQueryField-test.js @@ -334,6 +334,7 @@ describe('RelayQueryField', () => { null, undefined, ], + type: null, }, ]); }); @@ -363,7 +364,7 @@ describe('RelayQueryField', () => { Relay.QL`fragment on User { friends(first:"10",isViewerFriend:true) }` ).getChildren()[0]; expect(connectionField.getRangeBehaviorCalls()) - .toEqual([{name: 'isViewerFriend', value: true}]); + .toEqual([{name: 'isViewerFriend', value: true, type: null}]); }); it('throws for non-connection fields', () => { @@ -385,6 +386,7 @@ describe('RelayQueryField', () => { expect(ifFalse.getRangeBehaviorCalls()).toEqual([{ name: 'if', value: false, + type: null, }]); }); @@ -395,6 +397,7 @@ describe('RelayQueryField', () => { expect(unlessTrue.getRangeBehaviorCalls()).toEqual([{ name: 'unless', value: true, + type: null, }]); const unlessFalse = getNode(Relay.QL` @@ -413,6 +416,7 @@ describe('RelayQueryField', () => { expect(friendsScalar.getRangeBehaviorCalls()).toEqual([{ name: 'isViewerFriend', value: false, + type: null, }]); const friendsVariableRQL = Relay.QL` @@ -424,6 +428,7 @@ describe('RelayQueryField', () => { expect(friendsVariable.getRangeBehaviorCalls()).toEqual([{ name: 'isViewerFriend', value: false, + type: null, }]); }); }); @@ -620,14 +625,14 @@ describe('RelayQueryField', () => { it('returns arguments with values', () => { // scalar values are converted to strings expect(friendsScalarField.getCallsWithValues()).toEqual([ - {name: 'first', value: '10'}, - {name: 'after', value: 'offset'}, - {name: 'orderby', value: 'name'}, + {name: 'first', value: '10', type: null}, + {name: 'after', value: 'offset', type: null}, + {name: 'orderby', value: 'name', type: null}, ]); // variables return their values expect(friendsVariableField.getCallsWithValues()).toEqual([ - {name: 'first', value: 10}, - {name: 'after', value: 'offset'}, + {name: 'first', value: 10, type: null}, + {name: 'after', value: 'offset', type: null}, ]); const pictureScalarRQL = Relay.QL` @@ -637,7 +642,7 @@ describe('RelayQueryField', () => { `; const pictureScalar = getNode(pictureScalarRQL).getChildren()[0]; expect(pictureScalar.getCallsWithValues()).toEqual([ - {name: 'size', value: ['32', '64']}, + {name: 'size', value: ['32', '64'], type: null}, ]); const pictureVariableRQL = Relay.QL` @@ -652,7 +657,7 @@ describe('RelayQueryField', () => { const pictureVariable = getNode(pictureVariableRQL, variables).getChildren()[0]; expect(pictureVariable.getCallsWithValues()).toEqual([ - {name: 'size', value: [32, '64']}, + {name: 'size', value: [32, '64'], type: null}, ]); }); @@ -664,7 +669,7 @@ describe('RelayQueryField', () => { } `, variables).getChildren()[0]; expect(profilePicture.getCallsWithValues()).toEqual( - [{name: 'size', value: [32, 64]}] + [{name: 'size', value: [32, 64], type: null}] ); }); @@ -792,7 +797,7 @@ describe('RelayQueryField', () => { expect(field.getDirectives()).toEqual([ { args: [ - {name: 'if', value: true}, + {name: 'if', value: true, type: null}, ], name: 'include', }, diff --git a/src/query/__tests__/RelayQueryFragment-test.js b/src/query/__tests__/RelayQueryFragment-test.js index 0e9e7b2f68f79..e809cea223551 100644 --- a/src/query/__tests__/RelayQueryFragment-test.js +++ b/src/query/__tests__/RelayQueryFragment-test.js @@ -197,7 +197,7 @@ describe('RelayQueryFragment', () => { expect(fragment.getDirectives()).toEqual([ { args: [ - {name: 'if', value: true}, + {name: 'if', value: true, type: null}, ], name: 'include', }, diff --git a/src/query/__tests__/RelayQueryMutation-test.js b/src/query/__tests__/RelayQueryMutation-test.js index b730d81f61659..fef6727c4f149 100644 --- a/src/query/__tests__/RelayQueryMutation-test.js +++ b/src/query/__tests__/RelayQueryMutation-test.js @@ -57,6 +57,7 @@ describe('RelayQueryMutation', () => { expect(mutationQuery.getCall()).toEqual({ name: 'commentCreate', value: input, + type: null, }); const children = mutationQuery.getChildren(); expect(children.length).toBe(2); diff --git a/src/query/__tests__/RelayQueryRoot-test.js b/src/query/__tests__/RelayQueryRoot-test.js index b9e48a4748455..30b0429aff4cc 100644 --- a/src/query/__tests__/RelayQueryRoot-test.js +++ b/src/query/__tests__/RelayQueryRoot-test.js @@ -441,7 +441,7 @@ describe('RelayQueryRoot', () => { expect(query.getDirectives()).toEqual([ { args: [ - {name: 'if', value: true}, + {name: 'if', value: true, type: null}, ], name: 'include', }, diff --git a/src/query/__tests__/buildRQL-test.js b/src/query/__tests__/buildRQL-test.js index 7b40f73a3be81..2fbda15463fc6 100644 --- a/src/query/__tests__/buildRQL-test.js +++ b/src/query/__tests__/buildRQL-test.js @@ -100,7 +100,7 @@ describe('buildRQL', () => { expect(children[1].getSchemaName()).toBe('profilePicture'); // Variable has the applied value, not initial value. expect(children[1].getCallsWithValues()).toEqual([ - {name: 'size', value: '32'}, + {name: 'size', value: '32', type: null}, ]); }); diff --git a/src/query/__tests__/createRelayQuery-test.js b/src/query/__tests__/createRelayQuery-test.js index f580a645a3d3b..e016f688cb817 100644 --- a/src/query/__tests__/createRelayQuery-test.js +++ b/src/query/__tests__/createRelayQuery-test.js @@ -47,7 +47,7 @@ describe('createRelayQuery', () => { ); expect(root instanceof RelayQuery.Root).toBe(true); expect(root.getFieldByStorageKey('newsFeed').getCallsWithValues()).toEqual( - [{name: 'first', value: 10}] + [{name: 'first', value: 10, type: null}] ); }); });