-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.gql
84 lines (67 loc) · 1.25 KB
/
schema.gql
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
73
74
75
76
77
78
79
80
81
82
83
84
type Query {
hello: String
me: UserResult!
questions: [Question!]
question(id: ID!): Question
answers: [Answer!]
answer(id: ID!): Answer
}
type Mutation {
signup(input: AuthInput!): AuthResult!
signin(input: AuthInput!): AuthResult!
questionCreate(input: QuestionInput!): QuestionResult!
questionUpdate(id: ID!, input: QuestionInput!): QuestionResult!
questionDelete(id: ID!): QuestionResult!
answerCreate(input: AnswerInput!): AnswerResult!
answerUpdate(id: ID!, input: AnswerInput!): AnswerResult!
answerDelete(id: ID!): AnswerResult!
}
type User {
id: ID!
username: String!
questions: [Question!]!
answers: [Answer!]!
}
type UserResult {
error: String
user: User
}
input AuthInput {
username: String!
password: String!
}
type AuthResult {
error: String
token: String
}
type Question {
id: ID!
title: String!
content: String!
tags: String!
user: User!
answers: [Answer!]!
}
input QuestionInput {
title: String!
content: String!
tags: String!
}
type QuestionResult {
error: String
question: Question
}
type Answer {
id: ID!
content: String!
question: Question!
user: User!
}
input AnswerInput {
content: String!
questionId: ID!
}
type AnswerResult {
error: String
answer: Answer
}