forked from benawad/graphql-express-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.js
39 lines (34 loc) · 826 Bytes
/
schema.js
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
export default `
type Suggestion {
id: Int!
text: String!
creator: User!
}
type Board {
id: Int!
name: String!
suggestions: [Suggestion!]!
owner: Int!
}
type User {
id: Int!
username: String!
createdAt: String!
updatedAt: String!
boards: [Board!]!
suggestions: [Suggestion!]!
}
type Query {
allUsers: [User!]!
getUser(username: String!): User
userBoards(owner: String!): [Board!]!
userSuggestions(creatorId: String!): [Suggestion!]!
}
type Mutation {
createUser(username: String!): User
updateUser(username: String!, newUsername: String!): [Int!]!
deleteUser(username: String!): Int!
createBoard(owner: Int!, name: String): Board!
createSuggestion(creatorId: Int!, text: String, boardId: Int!): Suggestion!
}
`;