Created
June 2, 2021 15:41
-
-
Save bengrunfeld/c533d093ad75522eed3ca5933ec63113 to your computer and use it in GitHub Desktop.
Scalable GraphQL User Resolvers
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 queries = { | |
user: (root, args) => { | |
return { | |
id: "12345", | |
email: "[email protected]", | |
password: "Pa$$w0rd!", | |
loggedIn: false, | |
firstName: "Some", | |
lastName: "User", | |
}; | |
}, | |
}; | |
const mutations = { | |
createUser: (root, args) => { | |
const newUser = { | |
id: "54321", | |
email: args.email, | |
password: args.password, | |
loggedIn: false, | |
firstName: args.firstName, | |
lastName: args.lastName, | |
}; | |
return newUser; | |
}, | |
}; | |
export const resolvers = { queries, mutations }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment