-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed logic that checked whether new federation features are sup…
…ported Old logic was just comparing imported spec to a specific version instead of a range.
- Loading branch information
1 parent
743f004
commit 3bf838e
Showing
4 changed files
with
123 additions
and
25 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
70 changes: 59 additions & 11 deletions
70
graphql-java-support/src/test/resources/schemas/federationV2.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 |
---|---|---|
@@ -1,33 +1,81 @@ | ||
extend schema | ||
@link(url: "https://specs.apollo.dev/federation/v2.0", | ||
import: ["@key", "@shareable", "@provides", "@external", "@tag", "@extends", "@override", "@inaccessible"]) | ||
@link( | ||
url: "https://specs.apollo.dev/federation/v2.3" | ||
import: [ | ||
"@composeDirective" | ||
"@extends" | ||
"@external" | ||
"@key" | ||
"@inaccessible" | ||
"@interfaceObject" | ||
"@override" | ||
"@provides" | ||
"@requires" | ||
"@shareable" | ||
"@tag" | ||
] | ||
) | ||
@link(url: "https://myspecs.dev/myCustomDirective/v1.0", import: ["@custom"]) | ||
@composeDirective(name: "@custom") | ||
|
||
type Product @key(fields: "id") @key(fields: "sku package") @key(fields: "sku variation { id }") { | ||
directive @custom on OBJECT | ||
|
||
type Product | ||
@custom | ||
@key(fields: "id") | ||
@key(fields: "sku package") | ||
@key(fields: "sku variation { id }") { | ||
id: ID! | ||
sku: String | ||
package: String | ||
variation: ProductVariation | ||
dimensions: ProductDimension | ||
createdBy: User @provides(fields: "totalProductsCreated") | ||
notes: String @tag(name: "internal") | ||
research: [ProductResearch!]! | ||
} | ||
|
||
type DeprecatedProduct @key(fields: "sku package") { | ||
sku: String! | ||
package: String! | ||
reason: String | ||
createdBy: User | ||
} | ||
|
||
type ProductVariation { | ||
id: ID! | ||
id: ID! | ||
} | ||
|
||
type ProductResearch @key(fields: "study { caseNumber }") { | ||
study: CaseStudy! | ||
outcome: String | ||
} | ||
|
||
type CaseStudy { | ||
caseNumber: ID! | ||
description: String | ||
} | ||
|
||
type ProductDimension @shareable { | ||
size: String | ||
weight: Float | ||
unit: String @inaccessible | ||
size: String | ||
weight: Float | ||
unit: String @inaccessible | ||
} | ||
|
||
type Query { | ||
product(id: ID!): Product | ||
product(id: ID!): Product | ||
deprecatedProduct(sku: String!, package: String!): DeprecatedProduct @deprecated(reason: "Use product query instead") | ||
} | ||
|
||
type User @key(fields: "email") { | ||
email: ID! | ||
name: String @shareable @override(from: "users") | ||
totalProductsCreated: Int @external | ||
averageProductsCreatedPerYear: Int @requires(fields: "totalProductsCreated yearsOfEmployment") | ||
email: ID! @external | ||
name: String @override(from: "users") | ||
totalProductsCreated: Int @external | ||
yearsOfEmployment: Int! @external | ||
} | ||
|
||
type Inventory @interfaceObject @key(fields: "id") { | ||
id: ID! | ||
deprecatedProducts: [DeprecatedProduct!]! | ||
} |
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