-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't import locally defined fragment types
Reviewed By: kassens Differential Revision: D6849018 fbshipit-source-id: 84636771b23c9285f49a13527162613d8d7edd17
- Loading branch information
1 parent
970c254
commit 7985449
Showing
3 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
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
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
6 changes: 6 additions & 0 deletions
6
packages/relay-compiler/core/__tests__/fixtures/flow-generator/recursive-fragments.graphql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fragment FragmentSpread on Node { | ||
id | ||
... @include(if: $condition) { | ||
...FragmentSpread | ||
} | ||
} |
7985449
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation behind this commit?
Is it somehow possible to make circular references between fragments now? I have looked at the graphql-js repo and here for anything indicating this behavior and couldn't find anything.
7985449
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @devknoll, I believe it is possible to recursively reference fragments now
7985449
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With fragment arguments (and constant folding), it's possible that queries that are self-referential will be compiled down to valid queries. For that reason, we loosened the restriction a bit.