Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created September 10, 2019 09:50
Show Gist options
  • Save tkssharma/42e903770042e9ecb939cc570c3bc266 to your computer and use it in GitHub Desktop.
Save tkssharma/42e903770042e9ecb939cc570c3bc266 to your computer and use it in GitHub Desktop.
const { gql } = require('apollo-server-express');
module.exports = gql`
extend type Query {
users: [User]
user(email: String!): User
me: User
}
type Response {
success: Boolean!
message: String!
description: String!
}
extend type Mutation {
makeUser(name: String!): User!
removeUser(id: Int!): Boolean
register(
name: String!
first_name: String!
last_name: String!
username: String!
email: String!
password: String!
): Response!
login(email: String!, password: String!): Token!
}
type User {
id: ID
first_name: String
last_name: String
username: String!
email: String!
address: String
type: String
}
type Token {
token: String!
success: Boolean!
message: String!
description: String!
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment