-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathschema.graphql
More file actions
116 lines (93 loc) · 2.3 KB
/
schema.graphql
File metadata and controls
116 lines (93 loc) · 2.3 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type User {
id: ID!
username: String!
email: String!
}
type InputError {
field: String!
messages: [String!]!
}
type Post {
id: ID!
content: String!
author: User!
created: DateTime!
}
"""
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
"""
scalar DateTime
type Query {
users: [User!]!
user(username: String!): User!
me: User!
posts: [Post!]!
}
type Mutation {
removeUser(id: ID!): User!
login(input: LoginUserInput!): [LoginUserResult!]!
register(input: RegisterUserInput!): [RegisterUserResult!]!
loginSocial(input: LoginSocialInput!): [LoginSocialResult!]!
registerSocial(input: RegisterSocialInput!): [RegisterSocialResult!]!
addPost(input: AddPostInput!): Post!
}
union LoginUserResult = AuthUserResponse | InvalidCredentialsError
type AuthUserResponse {
user: User!
token: String!
}
type InvalidCredentialsError implements ErrorResponse {
message: String!
providedUsername: String!
}
interface ErrorResponse {
message: String!
}
input LoginUserInput {
username: String!
password: String!
}
union RegisterUserResult = AuthUserResponse | InvalidInputError | CredentialsTakenError
type InvalidInputError implements ErrorResponse {
message: String!
errors: [InputError!]!
}
type CredentialsTakenError implements ErrorResponse {
message: String!
providedUsername: String!
providedEmail: String!
}
input RegisterUserInput {
username: String!
email: String!
password: String!
}
union LoginSocialResult = AuthUserResponse | SocialNotRegisteredError
type SocialNotRegisteredError implements ErrorResponse {
message: String!
provider: SocialAuthProviders!
}
enum SocialAuthProviders {
FACEBOOK
GOOGLE
}
input LoginSocialInput {
accessToken: String!
provider: SocialAuthProviders!
}
union RegisterSocialResult = AuthUserResponse | SocialAlreadyAssignedError | CredentialsTakenError
type SocialAlreadyAssignedError implements ErrorResponse {
message: String!
provider: SocialAuthProviders!
}
input RegisterSocialInput {
accessToken: String!
provider: SocialAuthProviders!
username: String!
}
input AddPostInput {
content: String!
}