From c8ef968d66704d70bfb095bbafe8fba9812a594c Mon Sep 17 00:00:00 2001 From: Joseph Savona Date: Mon, 21 Sep 2015 08:53:18 -0700 Subject: [PATCH] diffRelayQuery: split plural roots with array calls --- src/traversal/__tests__/diffRelayQuery-test.js | 8 ++++---- src/traversal/diffRelayQuery.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/traversal/__tests__/diffRelayQuery-test.js b/src/traversal/__tests__/diffRelayQuery-test.js index e72b60c1446a5..29ab077f0a9fd 100644 --- a/src/traversal/__tests__/diffRelayQuery-test.js +++ b/src/traversal/__tests__/diffRelayQuery-test.js @@ -672,11 +672,11 @@ describe('diffRelayQuery', () => { expect(diffQueries.length).toBe(2); expect(diffQueries[0].getName()).toBe(query.getName()); expect(diffQueries[0]).toEqualQueryRoot(getNode( - Relay.QL`query{nodes(ids:"4") {id, name}}` + Relay.QL`query{nodes(ids:["4"]) {id, name}}` )); expect(diffQueries[1].getName()).toBe(query.getName()); expect(diffQueries[1]).toEqualQueryRoot(getNode( - Relay.QL`query{nodes(ids:"4808495") {id, name}}` + Relay.QL`query{nodes(ids:["4808495"]) {id, name}}` )); }); @@ -1147,7 +1147,7 @@ describe('diffRelayQuery', () => { `; var expected0 = getNode(Relay.QL` query { - nodes(ids:"4") { + nodes(ids:["4"]) { id, ${firstNameFrag}, ${expectedFragment}, @@ -1156,7 +1156,7 @@ describe('diffRelayQuery', () => { `); var expected1 = getNode(Relay.QL` query { - nodes(ids:"4808495") { + nodes(ids:["4808495"]) { id, name, ${defer(firstNameFrag)}, diff --git a/src/traversal/diffRelayQuery.js b/src/traversal/diffRelayQuery.js index c984b55aeb2c1..0d1652a2e52d0 100644 --- a/src/traversal/diffRelayQuery.js +++ b/src/traversal/diffRelayQuery.js @@ -81,7 +81,7 @@ function diffRelayQuery( ); nodeRoot = RelayQuery.Root.build( rootCallName, - rootCallArg, + [rootCallArg], root.getChildren(), { rootArg: root.getRootCallArgument(),