Created
September 10, 2019 09:50
-
-
Save tkssharma/42e903770042e9ecb939cc570c3bc266 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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