-
-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for fields from different subgraphs in skipped fragment
- Loading branch information
1 parent
c7cbf76
commit f241a64
Showing
3 changed files
with
76 additions
and
8 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
39 changes: 39 additions & 0 deletions
39
...pshots__/SkipFragmentTests.Skipped_Sub_Fragment_With_Fields_From_Different_Subgraphs.yaml
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,39 @@ | ||
request: | ||
- document: >- | ||
query($slug: String!, $skip: Boolean!) { | ||
productBySlug(slug: $slug) { | ||
... on Product @skip(if: $skip) { | ||
name | ||
averageRating | ||
} | ||
} | ||
} | ||
nodes: | ||
- id: 1 | ||
schema: "PRODUCTS" | ||
operation: >- | ||
query($skip: Boolean!, $slug: String!) { | ||
productBySlug(slug: $slug) { | ||
... on Product @skip(if: $skip) { | ||
name | ||
} | ||
id | ||
} | ||
} | ||
- id: 2 | ||
schema: "REVIEWS" | ||
operation: >- | ||
query($__fusion_requirement_1: ID!) { | ||
productById(id: $__fusion_requirement_1) { | ||
... on Product { | ||
averageRating | ||
} | ||
} | ||
} | ||
skipIf: "skip" | ||
requirements: | ||
- name: "__fusion_requirement_1" | ||
dependsOn: "1" | ||
selectionSet: "productBySlug" | ||
field: "id" | ||
type: "ID!" |