-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.gql
More file actions
97 lines (85 loc) · 2.06 KB
/
schema.gql
File metadata and controls
97 lines (85 loc) · 2.06 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
# -----------------------------------------------
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
# -----------------------------------------------
type Auth {
username: String!
token: String!
}
type CommentEntity {
id: ID!
created_at: DateTime!
body: String!
author: UserEntity!
idea: IdeaEntity!
}
input CreateComment {
body: String!
}
input CreateIdea {
title: String!
description: String!
}
"""
The javascript `Date` as string. Type represents date and time as the ISO Date string.
"""
scalar DateTime
type IdeaEntity {
id: ID!
title: String!
description: String!
created_at: DateTime!
updated_at: DateTime!
author: UserEntity!
upvotes: [UserEntity!]!
downvotes: [UserEntity!]!
comments: [CommentEntity!]!
}
input LoginUser {
email: String!
password: String!
}
type Mutation {
createIdea(data: CreateIdea!): IdeaEntity!
updateIdea(data: CreateIdea!, id: String!): IdeaEntity!
destroyIdea(id: String!): IdeaEntity!
login(data: LoginUser!): Auth!
register(data: RegisterUser!): UserEntity!
bookmark(idea: String!): UserEntity!
destroy(idea: String!): UserEntity!
upvote(idea: String!): UserEntity!
downvote(idea: String!): UserEntity!
createComment(data: CreateComment!, id: String!): CommentEntity!
destroyComment(id: String!): CommentEntity!
}
type Query {
ideas(page: Float = 1): [IdeaEntity!]!
idea(id: String!): IdeaEntity!
users(page: Float = 1): [UserEntity!]!
me: UserEntity!
bookmarks: UserEntity!
votes: UserEntity!
showComment(id: String!): CommentEntity!
indexIdeaComments(page: Float = 1, id: String!): [CommentEntity!]!
indexUserComments(page: Float = 1, id: String!): [CommentEntity!]!
}
input RegisterUser {
email: String!
password: String!
password_confirmation: String!
username: String!
}
type UserEntity {
id: ID!
created_at: DateTime!
username: String!
email: String!
ideas: [IdeaEntity!]!
comments: [IdeaEntity!]
bookmarks: [IdeaEntity!]
upvotes: [IdeaEntity!]
downvotes: [IdeaEntity!]
}
input UUID {
id: String!
}