-
Notifications
You must be signed in to change notification settings - Fork 0
/
typeDefs.graphql
66 lines (57 loc) · 1.06 KB
/
typeDefs.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
# PhotoShare GraphQL Schema
scalar DateTime
scalar Upload
type User {
id: ID!
name: String!
githubLogin: String!
avatar: String!
postedPhotos: [Photo!]!
inPhotos: [Photo!]!
}
type Photo {
id: ID!
name: String!
url: String!
description: String
category: PhotoCategory!
postedBy: User!
taggedUsers: [User!]!
created: DateTime!
}
enum PhotoCategory {
PORTRAIT
ACTION
LANDSCAPE
GRAPHIC
}
input PostPhotoInput {
name: String!
description: String
category: PhotoCategory=PORTRAIT
file: Upload!
}
type AuthPayload {
token: String!
user: User!
}
type Query {
me: User
totalPhotos: Int!
allPhotos: [Photo!]!
Photo(id: ID!): Photo
totalUsers: Int!
allUsers: [User!]!
User(id: ID!): User
}
type Mutation {
fakeUserAuth(id: ID!): AuthPayload!
githubAuth(code: String!): AuthPayload!
postPhoto(input:PostPhotoInput!): Photo!
tagPhoto(userID:ID! photoID:ID!): Photo!
addFakeUsers(count: Int = 10): [User!]!
}
type Subscription {
newUser: User!
newPhoto: Photo!
}