Skip to content

Commit

Permalink
Visit SplitOperation in ApplyFragmentArgumentTransform and SkipUnreac…
Browse files Browse the repository at this point in the history
…hableNodeTransform

Reviewed By: kassens, tyao1

Differential Revision: D20806927

fbshipit-source-id: f645ccfd01442cfbf1d2367163fd9b1258a5081e
  • Loading branch information
alunyov authored and facebook-github-bot committed Apr 2, 2020
1 parent d11e649 commit 8cfd01d
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 380 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5904,12 +5904,6 @@ Source: GraphQL request (12:3)
exports[`compileRelayArtifacts matches expected output: fragment-with-match-directive.graphql 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query Test {
node {
...NameRendererFragment
}
}
fragment NameRendererFragment on User {
id
nameRenderer @match {
Expand All @@ -5934,152 +5928,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
}
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
Request {
fragment: Fragment {
argumentDefinitions: [],
metadata: null,
name: "Test",
selections: [
LinkedField {
alias: null,
args: null,
concreteType: null,
name: "node",
plural: false,
selections: [
FragmentSpread {
args: null,
name: "NameRendererFragment",
},
],
storageKey: null,
},
],
type: "Query",
},
operation: Operation {
argumentDefinitions: [],
name: "Test",
selections: [
LinkedField {
alias: null,
args: null,
concreteType: null,
name: "node",
plural: false,
selections: [
ScalarField {
alias: null,
args: null,
name: "__typename",
storageKey: null,
},
ScalarField {
alias: null,
args: null,
name: "id",
storageKey: null,
},
InlineFragment {
selections: [
LinkedField {
alias: null,
args: [
Literal {
name: "supported",
value: [
"PlainUserNameRenderer",
"MarkdownUserNameRenderer",
],
},
],
concreteType: null,
name: "nameRenderer",
plural: false,
selections: [
ScalarField {
alias: null,
args: null,
name: "__typename",
storageKey: null,
},
InlineFragment {
selections: [
ModuleImport {
documentName: "NameRendererFragment",
fragmentName: "PlainUserNameRenderer_name",
fragmentPropName: "name",
},
],
type: "PlainUserNameRenderer",
},
InlineFragment {
selections: [
ModuleImport {
documentName: "NameRendererFragment",
fragmentName: "MarkdownUserNameRenderer_name",
fragmentPropName: "name",
},
],
type: "MarkdownUserNameRenderer",
},
],
storageKey: "nameRenderer(supported:[\\"PlainUserNameRenderer\\",\\"MarkdownUserNameRenderer\\"])",
},
],
type: "User",
},
],
storageKey: null,
},
],
},
}
QUERY:
query Test {
node {
__typename
...NameRendererFragment
id
}
}
fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
markdown
data {
markup
id
}
}
fragment NameRendererFragment on User {
id
nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {
__typename
... on PlainUserNameRenderer {
...PlainUserNameRenderer_name
__module_operation_NameRendererFragment: js(module: "PlainUserNameRenderer_name$normalization.graphql", id: "NameRendererFragment.nameRenderer")
__module_component_NameRendererFragment: js(module: "PlainUserNameRenderer.react", id: "NameRendererFragment.nameRenderer")
}
... on MarkdownUserNameRenderer {
...MarkdownUserNameRenderer_name
__module_operation_NameRendererFragment: js(module: "MarkdownUserNameRenderer_name$normalization.graphql", id: "NameRendererFragment.nameRenderer")
__module_component_NameRendererFragment: js(module: "MarkdownUserNameRenderer.react", id: "NameRendererFragment.nameRenderer")
}
}
}
fragment PlainUserNameRenderer_name on PlainUserNameRenderer {
plaintext
data {
text
id
}
}
SplitOperation {
metadata: {
"derivedFrom": "PlainUserNameRenderer_name",
Expand Down Expand Up @@ -8116,12 +7964,6 @@ Source: GraphQL request (13:7)
exports[`compileRelayArtifacts matches expected output: match-on-child-of-plural.graphql 1`] = `
~~~~~~~~~~ INPUT ~~~~~~~~~~
query Test {
node {
...ActorsRendererFragment
}
}
fragment ActorsRendererFragment on Node {
id
actors {
Expand All @@ -8148,173 +7990,6 @@ fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
}
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
Request {
fragment: Fragment {
argumentDefinitions: [],
metadata: null,
name: "Test",
selections: [
LinkedField {
alias: null,
args: null,
concreteType: null,
name: "node",
plural: false,
selections: [
FragmentSpread {
args: null,
name: "ActorsRendererFragment",
},
],
storageKey: null,
},
],
type: "Query",
},
operation: Operation {
argumentDefinitions: [],
name: "Test",
selections: [
LinkedField {
alias: null,
args: null,
concreteType: null,
name: "node",
plural: false,
selections: [
ScalarField {
alias: null,
args: null,
name: "__typename",
storageKey: null,
},
ScalarField {
alias: null,
args: null,
name: "id",
storageKey: null,
},
LinkedField {
alias: null,
args: null,
concreteType: null,
name: "actors",
plural: true,
selections: [
ScalarField {
alias: null,
args: null,
name: "__typename",
storageKey: null,
},
LinkedField {
alias: null,
args: [
Literal {
name: "supported",
value: [
"PlainUserNameRenderer",
"MarkdownUserNameRenderer",
],
},
],
concreteType: null,
name: "nameRenderer",
plural: false,
selections: [
ScalarField {
alias: null,
args: null,
name: "__typename",
storageKey: null,
},
InlineFragment {
selections: [
ModuleImport {
documentName: "ActorsRendererFragment",
fragmentName: "PlainUserNameRenderer_name",
fragmentPropName: "name",
},
],
type: "PlainUserNameRenderer",
},
InlineFragment {
selections: [
ModuleImport {
documentName: "ActorsRendererFragment",
fragmentName: "MarkdownUserNameRenderer_name",
fragmentPropName: "name",
},
],
type: "MarkdownUserNameRenderer",
},
],
storageKey: "nameRenderer(supported:[\\"PlainUserNameRenderer\\",\\"MarkdownUserNameRenderer\\"])",
},
ScalarField {
alias: null,
args: null,
name: "id",
storageKey: null,
},
],
storageKey: null,
},
],
storageKey: null,
},
],
},
}
QUERY:
query Test {
node {
__typename
...ActorsRendererFragment
id
}
}
fragment ActorsRendererFragment on Node {
id
actors {
__typename
nameRenderer(supported: ["PlainUserNameRenderer", "MarkdownUserNameRenderer"]) {
__typename
... on PlainUserNameRenderer {
...PlainUserNameRenderer_name
__module_operation_ActorsRendererFragment: js(module: "PlainUserNameRenderer_name$normalization.graphql", id: "ActorsRendererFragment.actors.nameRenderer")
__module_component_ActorsRendererFragment: js(module: "PlainUserNameRenderer.react", id: "ActorsRendererFragment.actors.nameRenderer")
}
... on MarkdownUserNameRenderer {
...MarkdownUserNameRenderer_name
__module_operation_ActorsRendererFragment: js(module: "MarkdownUserNameRenderer_name$normalization.graphql", id: "ActorsRendererFragment.actors.nameRenderer")
__module_component_ActorsRendererFragment: js(module: "MarkdownUserNameRenderer.react", id: "ActorsRendererFragment.actors.nameRenderer")
}
}
id
}
}
fragment MarkdownUserNameRenderer_name on MarkdownUserNameRenderer {
markdown
data {
markup
id
}
}
fragment PlainUserNameRenderer_name on PlainUserNameRenderer {
plaintext
data {
text
id
}
}
SplitOperation {
metadata: {
"derivedFrom": "PlainUserNameRenderer_name",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
query Test {
node {
...NameRendererFragment
}
}

fragment NameRendererFragment on User {
id
nameRenderer @match {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
query Test {
node {
...ActorsRendererFragment
}
}

fragment ActorsRendererFragment on Node {
id
actors {
Expand Down
Loading

0 comments on commit 8cfd01d

Please sign in to comment.