-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update product subgraph test schema with additional @key test cases
Update `product` subgraph with additional entites to separate testing for various `@key` test cases. Previously we were testing single entity that was supposed to define multiple `@key` directives. This was problematic as not all implementations support repeatable directives and we never checked whether given `@key` test case was actually present in the schema (test was executing `_entities` query only). Schema changes (existing fields and types are omitted for clarity): ```graphql type Product @key(fields: "id") @key(fields: "sku package") @key(fields: "sku variation { id }") { # new field research: [ProductResearch!]! } type DeprecatedProduct @key(fields: "sku package") { sku: String! package: String! reason: String createdBy: User } type ProductResearch @key(fields: "study { caseNumber }") { study: CaseStudy! outcome: String } type CaseStudy { caseNumber: ID! description: String } extend type Query { # new query deprecatedProduct(sku: String!, package: String!): DeprecatedProduct @deprecated(reason: "Use product query instead") } ``` Update `@key` tests cases to verify: * single field `@key` functionality against `User` type * multiple field `@key` functionality against `DeprecatedProduct` type * composite object `@key` functionality against `ProductResearch` type * repeatable `@key` functionality against `Product` type (this test combines old tests into a single one) Related Issues: * resolves apollographql#144 * resolves apollographql#149
- Loading branch information
1 parent
d189a9a
commit 9f95499
Showing
9 changed files
with
432 additions
and
128 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
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
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
Oops, something went wrong.