-
Notifications
You must be signed in to change notification settings - Fork 44
/
supergraph.graphql
92 lines (75 loc) · 2.8 KB
/
supergraph.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
schema
@core(feature: "https://specs.apollo.dev/core/v0.2"),
@core(feature: "https://specs.apollo.dev/join/v0.1", for: EXECUTION),
@core(feature: "https://specs.apollo.dev/tag/v0.1")
{
query: Query
}
directive @core(as: String, feature: String!, for: core__Purpose) repeatable on SCHEMA
directive @join__field(graph: join__Graph, provides: join__FieldSet, requires: join__FieldSet) on FIELD_DEFINITION
directive @join__graph(name: String!, url: String!) on ENUM_VALUE
directive @join__owner(graph: join__Graph!) on INTERFACE | OBJECT
directive @join__type(graph: join__Graph!, key: join__FieldSet) repeatable on INTERFACE | OBJECT
directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION
type DeliveryEstimates {
estimatedDelivery: String
fastestDelivery: String
}
type Panda {
favoriteFood: String
name: ID!
}
type Product
@join__owner(graph: PRODUCTS)
@join__type(graph: PRODUCTS, key: "id")
@join__type(graph: PRODUCTS, key: "sku package")
@join__type(graph: PRODUCTS, key: "sku variation{id}")
@join__type(graph: INVENTORY, key: "id")
{
createdBy: User @join__field(graph: PRODUCTS, provides: "totalProductsCreated")
delivery(zip: String): DeliveryEstimates @join__field(graph: INVENTORY, requires: "dimensions{size weight}")
dimensions: ProductDimension @join__field(graph: PRODUCTS)
id: ID! @join__field(graph: PRODUCTS) @tag(name: "hi-from-inventory") @tag(name: "hi-from-products")
package: String @join__field(graph: PRODUCTS)
sku: String @join__field(graph: PRODUCTS) @tag(name: "hi-from-products")
variation: ProductVariation @join__field(graph: PRODUCTS)
}
type ProductDimension {
size: String
weight: Float @tag(name: "hi-from-inventory-value-type-field")
}
type ProductVariation {
id: ID!
}
type Query {
allPandas: [Panda] @join__field(graph: PANDAS)
allProducts: [Product] @join__field(graph: PRODUCTS)
panda(name: ID!): Panda @join__field(graph: PANDAS)
product(id: ID!): Product @join__field(graph: PRODUCTS)
}
type User
@join__owner(graph: USERS)
@join__type(graph: USERS, key: "email")
@join__type(graph: PRODUCTS, key: "email")
{
email: ID! @join__field(graph: USERS)
name: String @join__field(graph: USERS)
totalProductsCreated: Int @join__field(graph: USERS)
}
enum core__Purpose {
"""
`EXECUTION` features provide metadata necessary to for operation execution.
"""
EXECUTION
"""
`SECURITY` features provide metadata necessary to securely resolve fields.
"""
SECURITY
}
scalar join__FieldSet
enum join__Graph {
INVENTORY @join__graph(name: "inventory" url: "http://inventory:4000/graphql")
PANDAS @join__graph(name: "pandas" url: "http://pandas:4000/graphql")
PRODUCTS @join__graph(name: "products" url: "http://products:4000/graphql")
USERS @join__graph(name: "users" url: "http://users:4000/graphql")
}