Skip to content

Instantly share code, notes, and snippets.

@gHashTag gHashTag/schema.js Secret
Created Nov 7, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.