Created
August 30, 2018 07:04
-
-
Save alloy/9f6a8b72ad84eb50c09016ac273ae524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Container.tsx b/src/Container.tsx | |
index f1e9310..6cd5815 100644 | |
--- a/src/Container.tsx | |
+++ b/src/Container.tsx | |
@@ -9,7 +9,7 @@ const query = graphql` | |
...FragmentOne_foo | |
}, | |
bar { | |
- ...FragmentTwo_bar | |
+ ...FragmentOne_bar | |
} | |
} | |
`; | |
diff --git a/src/FragmentOne.tsx b/src/FragmentOne.tsx | |
index db3aab2..8617445 100644 | |
--- a/src/FragmentOne.tsx | |
+++ b/src/FragmentOne.tsx | |
@@ -3,11 +3,11 @@ import {createFragmentContainer, graphql} from "react-relay"; | |
import FragmentTwo from "./FragmentTwo" | |
import { FragmentOne_foo } from "./generated/FragmentOne_foo.graphql"; | |
-import { FragmentTwo_bar } from "./generated/FragmentTwo_bar.graphql"; | |
+import { FragmentOne_bar } from "./generated/FragmentOne_bar.graphql"; | |
interface Props { | |
foo: FragmentOne_foo; | |
- bar: FragmentTwo_bar; | |
+ bar: FragmentOne_bar; | |
} | |
class FragmentOne extends React.Component<Props> { | |
@@ -26,5 +26,10 @@ export default createFragmentContainer(FragmentOne, { | |
id | |
name | |
} | |
+ `, | |
+ bar: graphql` | |
+ fragment FragmentOne_bar on Bar @relay(plural: true) { | |
+ ...FragmentTwo_bar | |
+ } | |
` | |
}); | |
diff --git a/src/generated/ContainerQuery.graphql.ts b/src/generated/ContainerQuery.graphql.ts | |
index ef205b5..5750511 100644 | |
--- a/src/generated/ContainerQuery.graphql.ts | |
+++ b/src/generated/ContainerQuery.graphql.ts | |
@@ -1,15 +1,15 @@ | |
/* tslint:disable */ | |
import { ConcreteRequest } from "relay-runtime"; | |
+import { FragmentOne_bar$ref } from "./FragmentOne_bar.graphql"; | |
import { FragmentOne_foo$ref } from "./FragmentOne_foo.graphql"; | |
-import { FragmentTwo_bar$ref } from "./FragmentTwo_bar.graphql"; | |
export type ContainerQueryVariables = {}; | |
export type ContainerQueryResponse = { | |
readonly foo: ({ | |
readonly " $fragmentRefs": FragmentOne_foo$ref; | |
}) | null; | |
readonly bar: ({ | |
- readonly " $fragmentRefs": FragmentTwo_bar$ref; | |
+ readonly " $fragmentRefs": FragmentOne_bar$ref; | |
}) | null; | |
}; | |
export type ContainerQuery = { | |
@@ -26,7 +26,7 @@ query ContainerQuery { | |
id | |
} | |
bar { | |
- ...FragmentTwo_bar | |
+ ...FragmentOne_bar | |
id | |
} | |
} | |
@@ -36,6 +36,10 @@ fragment FragmentOne_foo on Foo { | |
name | |
} | |
+fragment FragmentOne_bar on Bar { | |
+ ...FragmentTwo_bar | |
+} | |
+ | |
fragment FragmentTwo_bar on Bar { | |
id | |
name | |
@@ -64,7 +68,7 @@ return { | |
"operationKind": "query", | |
"name": "ContainerQuery", | |
"id": null, | |
- "text": "query ContainerQuery {\n foo {\n ...FragmentOne_foo\n id\n }\n bar {\n ...FragmentTwo_bar\n id\n }\n}\n\nfragment FragmentOne_foo on Foo {\n id\n name\n}\n\nfragment FragmentTwo_bar on Bar {\n id\n name\n}\n", | |
+ "text": "query ContainerQuery {\n foo {\n ...FragmentOne_foo\n id\n }\n bar {\n ...FragmentOne_bar\n id\n }\n}\n\nfragment FragmentOne_foo on Foo {\n id\n name\n}\n\nfragment FragmentOne_bar on Bar {\n ...FragmentTwo_bar\n}\n\nfragment FragmentTwo_bar on Bar {\n id\n name\n}\n", | |
"metadata": {}, | |
"fragment": { | |
"kind": "Fragment", | |
@@ -100,7 +104,7 @@ return { | |
"selections": [ | |
{ | |
"kind": "FragmentSpread", | |
- "name": "FragmentTwo_bar", | |
+ "name": "FragmentOne_bar", | |
"args": null | |
} | |
] | |
@@ -136,5 +140,5 @@ return { | |
} | |
}; | |
})(); | |
-(node as any).hash = 'cc4413fa3578f571904211aad5c7bd43'; | |
+(node as any).hash = 'c742183335169ffd378d6b07f1966c01'; | |
export default node; | |
diff --git a/src/generated/FragmentOne_bar.graphql.ts b/src/generated/FragmentOne_bar.graphql.ts | |
new file mode 100644 | |
index 0000000..9e78bfc | |
--- /dev/null | |
+++ b/src/generated/FragmentOne_bar.graphql.ts | |
@@ -0,0 +1,31 @@ | |
+/* tslint:disable */ | |
+ | |
+import { ConcreteFragment } from "relay-runtime"; | |
+import { FragmentTwo_bar$ref } from "./FragmentTwo_bar.graphql"; | |
+declare const _FragmentOne_bar$ref: unique symbol; | |
+export type FragmentOne_bar$ref = typeof _FragmentOne_bar$ref; | |
+export type FragmentOne_bar = ReadonlyArray<{ | |
+ readonly " $fragmentRefs": FragmentTwo_bar$ref; | |
+ readonly " $refType": FragmentOne_bar$ref; | |
+}>; | |
+ | |
+ | |
+ | |
+const node: ConcreteFragment = { | |
+ "kind": "Fragment", | |
+ "name": "FragmentOne_bar", | |
+ "type": "Bar", | |
+ "metadata": { | |
+ "plural": true | |
+ }, | |
+ "argumentDefinitions": [], | |
+ "selections": [ | |
+ { | |
+ "kind": "FragmentSpread", | |
+ "name": "FragmentTwo_bar", | |
+ "args": null | |
+ } | |
+ ] | |
+}; | |
+(node as any).hash = '006adaeec3600a2b77836f0e77f89490'; | |
+export default node; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment