/
users.schema
38 lines (34 loc) · 925 Bytes
/
users.schema
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
# User is the main type for the server.
type User {
# id is the unique identifier for this User.
id: ID!
# name is the name of this user.
name: String
# birthday doesn't have any real format, it is just another string.
birthday: String
# status doesn't mean anything, just a boolean field you can
# set to true or false
status: Boolean
}
# UserInput is a special input type you can supply a user input object with.
# For now you get a hash. Maybe we could auto-bless these into real classes?
input UserInput {
name: String
birthday: String
status: Boolean
}
# Top level queries.
type Query {
listusers(start: ID = "0", count: Int = 1): [User]
user(id: ID!): User
}
# Top level mutations.
type Mutation {
adduser(newuser: UserInput!): ID
updateuser(id: ID!, userinput: UserInput!): User
}
# Specify the main top level objects for the schema.
schema {
query: Query
mutation: Mutation
}