-
Notifications
You must be signed in to change notification settings - Fork 827
/
schema.graphql
101 lines (86 loc) · 3.93 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
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
# * deleteUser/Post/Profile, subscribeTo, unsubscribeFrom - to pass the tests you need to return any Scalar! value, in my case it is String!
schema {
query: RootQueryType
mutation: Mutations
}
input ChangePostInput {
title: String
content: String
}
input ChangeProfileInput {
isMale: Boolean
yearOfBirth: Int
memberTypeId: MemberTypeId
}
input ChangeUserInput {
name: String
balance: Float
}
input CreatePostInput {
title: String!
content: String!
authorId: UUID!
}
input CreateProfileInput {
isMale: Boolean!
yearOfBirth: Int!
userId: UUID!
memberTypeId: MemberTypeId!
}
input CreateUserInput {
name: String!
balance: Float!
}
type MemberType {
id: MemberTypeId!
discount: Float!
postsLimitPerMonth: Int!
}
enum MemberTypeId {
BASIC
BUSINESS
}
type Post {
id: UUID!
title: String!
content: String!
}
type Profile {
id: UUID!
isMale: Boolean!
yearOfBirth: Int!
memberType: MemberType!
}
type User {
id: UUID!
name: String!
balance: Float!
profile: Profile
posts: [Post!]!
userSubscribedTo: [User!]!
subscribedToUser: [User!]!
}
type RootQueryType {
memberTypes: [MemberType!]!
memberType(id: MemberTypeId!): MemberType
users: [User!]!
user(id: UUID!): User
posts: [Post!]!
post(id: UUID!): Post
profiles: [Profile!]!
profile(id: UUID!): Profile
}
type Mutations {
createUser(dto: CreateUserInput!): User!
createProfile(dto: CreateProfileInput!): Profile!
createPost(dto: CreatePostInput!): Post!
changePost(id: UUID!, dto: ChangePostInput!): Post!
changeProfile(id: UUID!, dto: ChangeProfileInput!): Profile!
changeUser(id: UUID!, dto: ChangeUserInput!): User!
deleteUser(id: UUID!): String!
deletePost(id: UUID!): String!
deleteProfile(id: UUID!): String!
subscribeTo(userId: UUID!, authorId: UUID!): String!
unsubscribeFrom(userId: UUID!, authorId: UUID!): String!
}
scalar UUID