-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.js
52 lines (39 loc) · 1006 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
40
41
42
43
44
45
46
47
48
49
50
51
52
exports.typeDefs =`
type Story {
_id: ID
name: String!
imageUrl: String!
category: String!
description: String!
instructions: String!
createdDate: String
likes: Int
username: String
}
type User {
_id: ID
username: String! @unique
password: String!
email: String!
joinDate: String
favorites: [Story]
}
type Query {
getAllStory: [Story]
getStory(_id:ID!): Story
getCurrentUser: User
searchStories: [Story]
getUserStories(username:String): [Story]
}
type Token {
token: String!
}
type Mutation {
addStory(name: String!, imageUrl: String!, description:String!, category: String!, instructions:String!, username: String): Story
signupUser(username: String!, email: String!, password: String! ): Token
signinUser(username: String! , password: String! ): Token
deleteStory(_id: ID): Story
likeStory(_id: ID!, username: String!): Story
unlikeStory(_id: ID!, username: String!): Story
}
`;