-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
64 lines (54 loc) · 1.16 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
exports.typeDefs = `
type Pet {
_id: ID
name: String!
category: String!
imageUrl: String!
desc: String!
text: String!
createdDate: String
likes: Int
username: String
}
type User {
_id: ID
username: String!
password: String!
email: String!
createdDate: String
favorites: [Pet]
}
type Query {
getAllPets: [Pet]
getPet(_id: ID!): Pet
searchPets(searchParam: String): [Pet]
getCurrentUser: User
getUserPosts(username: String!): [Pet]
}
type Token {
token: String!
}
type Mutation {
addPet(
name: String!
category: String!
desc: String!
text: String!
username: String
imageUrl: String!
): Pet
deleteUserPost(_id: ID): Pet
updateUserPost(
_id: ID,
name: String!
category: String!
desc: String!
text: String!
username: String
imageUrl: String!): Pet
likePet(_id: ID!, username: String!): Pet
unlikePet(_id: ID!, username: String!): Pet
signupUser(username: String!, email: String!, password: String!): Token
signinUser(email: String!, password: String!): Token
}
`;