-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
72 lines (60 loc) · 1.42 KB
/
schema.graphql
File metadata and controls
72 lines (60 loc) · 1.42 KB
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
schema {
query: Query
mutation: Mutation
}
type Query {
# Pings the backend; pong!
ping: String!
# Queries the current user (based on authorization bearer).
me: User!
# Queries a note.
user(userID: ID!): User!
# Queries a note.
note(noteID: ID!): Note!
}
type Mutation {
# Registers a new user.
registerUser(userInput: RegisterUserInput!): Boolean
# Creates a new note.
createNote(noteInput: NoteInput!): Boolean
# Updates a note.
updateNote(noteInput: NoteInput!): Boolean
# Deletes a note.
deleteNote(noteID: ID!): Boolean
}
type User {
userID: ID!
createdAt: String!
updatedAt: String!
email: String!
emailVerified: Boolean!
authProvider: String!
photoURL: String # TODO: Nullable?
displayName: String # TODO: Nullable?
username: String # TODO: Nullable?
# Connections:
notes(limit: Int, offset: Int, direction: String): [Note!]!
}
type Note {
userID: ID!
noteID: ID!
createdAt: String!
updatedAt: String!
data: String!
# Connections:
user: User!
}
# Used for registering a new user.
input RegisterUserInput {
userID: ID!
email: String!
emailVerified: Boolean!
authProvider: String!
photoURL: String # TODO: Nullable?
displayName: String # TODO: Nullable?
}
# Used for creating a new note and updating a note.
input NoteInput {
noteID: ID!
data: String!
}