Skip to content

Instantly share code, notes, and snippets.

@abhitheawesomecoder
Created November 5, 2017 04:37
Show Gist options
  • Save abhitheawesomecoder/725d9139240439f1f2998e43394cd065 to your computer and use it in GitHub Desktop.
Save abhitheawesomecoder/725d9139240439f1f2998e43394cd065 to your computer and use it in GitHub Desktop.
import {
makeExecutableSchema,
addMockFunctionsToSchema,
} from 'graphql-tools';
import resolvers from './resolvers';
const typeDefs = `
type User {
id: Int
firstName: String
lastName: String
email: String
jwt: String
}
type Query {
user(firstName: String, lastName: String): User
allUsers: [User]
}
type Mutation {
createUser(firstName: String!, lastName: String!): User
deleteUser(id: Int!): User
updateUser(id: Int!, firstName : String!, lastName: String!): User
login(email: String!, password: String!): User
signup(email: String!, password: String!): User
}
`;
export default makeExecutableSchema({ typeDefs, resolvers });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment