-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ariadne with new schema (#209)
Updates Ariadne's schema to match the latest schema, as mentioned here #166 I've moved the schema definition to a new file to make it easier to update in future, we could split the files more if needed 😊 Closes #180
- Loading branch information
Showing
4 changed files
with
252 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ariadne==0.15.1 | ||
ariadne==0.16.0b1 | ||
certifi==2020.12.5 | ||
click==7.1.2 | ||
graphql-core==3.2.1 | ||
|
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,70 @@ | ||
extend schema | ||
@link( | ||
url: "https://specs.apollo.dev/federation/v2.0", | ||
import: [ | ||
"@extends", | ||
"@external", | ||
"@key", | ||
"@inaccessible", | ||
"@override", | ||
"@provides", | ||
"@requires", | ||
"@shareable", | ||
"@tag" | ||
] | ||
) | ||
|
||
type Product | ||
@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! | ||
} | ||
|
||
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 | ||
} | ||
|
||
extend type Query { | ||
product(id: ID!): Product | ||
deprecatedProduct(sku: String!, package: String!): DeprecatedProduct @deprecated(reason: "Use product query instead") | ||
} | ||
|
||
|
||
type User @key(fields: "email") @extends { | ||
averageProductsCreatedPerYear: Int @requires(fields: "totalProductsCreated yearsOfEmployment") | ||
email: ID! @external | ||
name: String @override(from: "users") | ||
totalProductsCreated: Int @external | ||
yearsOfEmployment: Int! @external | ||
} |
Oops, something went wrong.