Created
June 7, 2019 22:06
-
-
Save felipe-ssilva/50225d71fabd4a7f4b928d06ffbdd657 to your computer and use it in GitHub Desktop.
This file contains 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 typeDefs = ` | |
type Mutation { | |
createUser(name: String!, email: String!): User | |
} | |
`; | |
const resolvers = { | |
Mutation: { | |
createUser: (parent, args) => { | |
const newUser = Object.assign({id: users.length + 1}, args); | |
users.push(newUser); | |
return newUser; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment