Skip to content

Instantly share code, notes, and snippets.

@eveporcello
Created May 1, 2019 08:18
Show Gist options
  • Save eveporcello/db1d72ea76246ed3d742424f52387d03 to your computer and use it in GitHub Desktop.
Save eveporcello/db1d72ea76246ed3d742424f52387d03 to your computer and use it in GitHub Desktop.
scalar DateTime
type Photo {
id: ID!
name: String!
description: String
category: PhotoCategory!
url: String
postedBy: User!
created: DateTime
}
type User {
githubLogin: ID!
name: String!
avatar: String!
postedPhotos: [Photo!]!
}
enum PhotoCategory {
PORTRAIT
LANDSCAPE
ACTION
SELFIE
}
input PostPhotoInput {
name: String!
description: String
category: PhotoCategory = PORTRAIT
file: Upload!
}
type PostPhotoPayload {
photo: Photo
user: User
timePosted: DateTime
}
type AuthPayload {
token: String!
user: User!
}
type Query {
me: User
totalPhotos: Int!
allPhotos(pageSize: Int): [Photo!]!
Photo(id: ID!): Photo!
totalUsers: Int!
allUsers: [User!]!
User(githubLogin: ID!): User
}
type Mutation {
postPhoto(input: PostPhotoInput!): PostPhotoPayload
githubAuth(code: String!): AuthPayload!
}
type Subscription {
newUser: User!
newPhoto: Photo!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment