Skip to content

Instantly share code, notes, and snippets.

@gHashTag
Created November 7, 2017 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gHashTag/618b169d7178db0aff7be183c0196880 to your computer and use it in GitHub Desktop.
Save gHashTag/618b169d7178db0aff7be183c0196880 to your computer and use it in GitHub Desktop.
export default`
scalar Date
type Status {
message: String!
}
type Auth {
token: String!
}
type User {
_id: ID!
username: String
email: String!
firstName: String
lastName: String
avatar: String
createdAt: Date!
updatedAt: Date!
}
type EventTimes {
start_time: Date!
end_time: Date!
}
type Me {
_id: ID!
username: String
email: String!
firstName: String
lastName: String
avatar: String
createdAt: Date!
updatedAt: Date!
}
type Event {
_id: ID!
name: String!
teacher: String!
cover: String
description: String
start_time: String
end_time: String
event_times: [EventTimes]
createdAt: Date!
updatedAt: Date!
}
type Tweet {
_id: ID
text: String!
user: User!
favoriteCount: Int!
createdAt: Date!
updatedAt: Date!
}
type Query {
getTweet(_id: ID!): Tweet
getEvent(_id: ID!): Event
getTweets: [Tweet]
getEvents: [Event]
getUserTweets: [Tweet]
me: Me
}
type Mutation {
createTweet(text: String!): Tweet
createEvent(name: String!, teacher: String!, cover: String, description: String, start_time: String, end_time: String ): Event
updateTweet(_id: ID!, text: String!): Tweet
updateEvent(_id: ID!, name: String!, teacher: String, cover: String, description: String, start_time: String, end_time: String): Event
deleteTweet(_id: ID!): Status
deleteEvent(_id: ID!): Status
signup(email: String!, fullName: String!, password: String!, avatar: String, username: String): Auth
login(email: String!, password: String!): Auth
}
schema {
query: Query
mutation: Mutation
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment