Skip to content

Commit

Permalink
Fix generated aliases for 3D fields with keys
Browse files Browse the repository at this point in the history
Reviewed By: jstejada

Differential Revision: D20544343

fbshipit-source-id: 38cbc947ad99f0db840ec18369fbc49924da3c50
  • Loading branch information
josephsavona authored and facebook-github-bot committed Mar 20, 2020
1 parent 704eb32 commit 84df7a4
Show file tree
Hide file tree
Showing 4 changed files with 585 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8849,8 +8849,8 @@ query MatchQuery {
__typename
... on PlainUserNameRenderer {
...PlainUserNameRenderer_name
__module_operation_MatchQuery: js(module: "PlainUserNameRenderer_name$normalization.graphql", id: "MatchQuery.node.nameRenderer")
__module_component_MatchQuery: js(module: "PlainUserNameRenderer.react", id: "MatchQuery.node.nameRenderer")
__module_operation_MatchQuery_nameRenderer: js(module: "PlainUserNameRenderer_name$normalization.graphql", id: "MatchQuery.node.nameRenderer")
__module_component_MatchQuery_nameRenderer: js(module: "PlainUserNameRenderer.react", id: "MatchQuery.node.nameRenderer")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/relay-compiler/transforms/MatchTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function visitFragmentSpread(

const normalizationName =
getNormalizationOperationName(spread.name) + '.graphql';
const componentKey = getModuleComponentKey(documentName);
const componentKey = getModuleComponentKey(moduleKey);
const componentField: ScalarField = {
alias: componentKey,
args: [
Expand Down Expand Up @@ -513,7 +513,7 @@ function visitFragmentSpread(
name: JS_FIELD_NAME,
type: jsModuleType,
};
const operationKey = getModuleOperationKey(documentName);
const operationKey = getModuleOperationKey(moduleKey);
const operationField: ScalarField = {
alias: operationKey,
args: [
Expand Down
Loading

0 comments on commit 84df7a4

Please sign in to comment.