-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.js
43 lines (38 loc) · 940 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
exports.typeDefs = `
type Recipe{
_id: ID
name: 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: [Recipe]
}
type Query{
getAllRecipes: [Recipe]
getRecipe(_id: ID!): Recipe
getCurrentUser: User
searchRecipes(searchTerm: String): [Recipe]
getUserRecipes(userName: String!): [Recipe]
}
type Token{
token: String!
}
type Mutation{
addRecipe(name: String!, category: String!, description: String!, instructions: String!,userName: String): Recipe
signUpUser(userName: String!, email: String!, password: String!): Token
signInUser(userName: String!, password: String! ): Token
deleteUserRecipe(_id: ID): Recipe
likeRecipe(_id: ID, userName: String!): Recipe
unlikeRecipe(_id: ID, userName: String!): Recipe
}
`;