-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
66 lines (56 loc) · 915 Bytes
/
schema.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
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
scalar Date
scalar Time
enum Role {
ADMIN
USER
GUEST
}
type User {
id: ID!
username: String!
age: Int
role: Role!
posts: [Post!]!
friends: [User!]!
}
type Post {
id: ID!
author: User!
text: String!
posted_at_date: Date!
posted_at_time: Time!
relatedPosts: [Post!]!
}
input UserOrderInput {
column: UserSortColumn!
order: SortOrder!
}
enum SortOrder {
ASC
DESC
}
enum UserSortColumn {
id
username
age
}
type Query {
users: [User!]!
usersOrdered(orderBy: [UserOrderInput!]): [User!]!
user(id: ID!): User
userExists(id: ID!): Boolean!
healthCheck: Boolean!
}
type Mutation {
createUser(username: String!, role: Role!, age: Int): User!
updateUser(id: ID!, username: String, role: Role, age: Int): User!
deleteUser(id: ID!): User!
}
type Subscription {
postAdded: Post!
}