Skip to content

Commit 859097f

Browse files
committed
add example sdl
1 parent 0fdf2c0 commit 859097f

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extend type Query {
2+
topProducts(first: Int = 5): [Product]
3+
}
4+
5+
type Product @key(fields: "upc") {
6+
upc: String!
7+
name: String
8+
price: Int
9+
weight: Int
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
type Review @key(fields: "id") {
2+
id: ID!
3+
body: String
4+
author: User @provides(fields: "username")
5+
product: Product
6+
}
7+
8+
extend type User @key(fields: "id") {
9+
id: ID! @external
10+
username: String @external
11+
reviews: [Review]
12+
}
13+
14+
extend type Product @key(fields: "upc") {
15+
upc: String! @external
16+
reviews: [Review]
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extend type Query {
2+
me: User
3+
user(id: ID!): User
4+
users: [User]
5+
}
6+
7+
type User @key(fields: "id") {
8+
id: ID!
9+
name: String
10+
username: String
11+
}

0 commit comments

Comments
 (0)