moosecouture
02/22/2018, 7:32 PMandre
02/22/2018, 7:36 PMandre
02/22/2018, 7:36 PMUser
type in your application schema again and omit the password
field.moosecouture
02/22/2018, 8:06 PMandre
02/22/2018, 8:12 PMinput RegisterInput {
username: String!
password: String!
}
type User {
id: ID!
username: String!
}
type Mutation {
register(input: RegisterInput!): User!
}
In your actual register
resolver function:
const register = (parent, args, context, info) => context.db.mutation.createUser({
data: {...}
}, info);
Here you persist the actual user object and return the result. Due to the fact that you've defined the User
type in your application schema with less fields, the return value won't contain more fields. The result will be "sliced" accurately, so to speak 🙂 Hope that helps.moosecouture
02/22/2018, 8:14 PMmoosecouture
02/22/2018, 8:15 PMandre
02/22/2018, 8:16 PMandre
02/22/2018, 8:16 PMmoosecouture
02/22/2018, 8:27 PM- operation: "*"
moosecouture
02/22/2018, 8:30 PM