-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathschema.graphql
71 lines (62 loc) · 1.22 KB
/
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
67
68
69
70
71
schema {
query: Query
mutation: Mutation
}
"The query type, represents all of the entry points into our object graph"
type Query {
getUser(id: ID!): User
getPet(id: ID!): Pet
getTag(title: String!): Tag
}
"The mutation type, represents all updates we can make to our data"
type Mutation {
addPet(pet: PetInput!): Pet
updatePet(pet: PetInput!): Pet
deletePet(userID: ID!, petID: ID!): Boolean
}
"what is needed for a pet"
type Pet {
id: ID
owner: User
name: String
tags: [Tag]
}
"Tag has everything needed for a tag"
type Tag {
id: ID
title: String
pets: [Pet]
}
"what is needed for a user"
type User {
id: ID
name: String
# user pets exposed as a full list
pets: [Pet]
# user pets exposed as a connection with edges
petsConnection(first: Int, after: ID): UserPetConnection!
}
"The connection between users and pets"
type UserPetConnection {
totalCount: Int!
edges: [UserPetEdge]
pageInfo: PageInfo!
}
"The edge of the user pet connection"
type UserPetEdge {
cursor: ID!
node: Pet
}
"Page info for pagination"
type PageInfo {
startCursor: ID
endCursor: ID
hasNextPage: Boolean!
hasPreviousPage: Boolean!
}
input PetInput {
id: ID
ownerID: ID!
name: String!
tagIDs: [Int]
}