Kelly
11/26/2018, 2:30 PMNovalis
11/26/2018, 2:32 PMKelly
11/26/2018, 2:33 PMKelly
11/26/2018, 2:34 PMKelly
11/26/2018, 2:35 PMNovalis
11/26/2018, 2:46 PMtype User {
email: String!
}
hope this code styling works, i'm pretty new to this hahaNovalis
11/26/2018, 2:47 PMKelly
11/26/2018, 2:50 PMKelly
11/26/2018, 2:50 PMtype User {
id: ID! @unique
name: String!
email: String! @unique
password: String!
circuits: [Circuit!]!
sends: [Send!]!
homegym: Gym
}
Kelly
11/26/2018, 2:51 PMKelly
11/26/2018, 2:51 PMNovalis
11/26/2018, 2:52 PMKelly
11/26/2018, 2:53 PMtest
{ }
Kelly
11/26/2018, 2:53 PMNovalis
11/26/2018, 2:56 PMArguments
category. It should be from type UserCreateInput!
. If you click on this, is there a email field as well?Novalis
11/26/2018, 2:57 PMtype UserCreateInput {
username: String!
email: String!
password: String!
//Some more field here maybe
}
Kelly
11/26/2018, 2:57 PMdata: UserCreateInput!
type UserCreateInput {
name: String!
email: String!
password: String!
circuits: CircuitCreateManyWithoutAddedByInput
sends: SendCreateManyWithoutUserInput
homegym: GymCreateOneInput
}
Novalis
11/26/2018, 2:59 PMKelly
11/26/2018, 3:01 PMKelly
11/26/2018, 3:02 PMasync function signup(parent, args, context, info) {
const password = await bcrypt.hash(args.password, 10)
const user = await context.db.mutation.createUser({
data: { ...args, password },
}, `{ id }`)
const token = jwt.sign({ userId: user.id }, APP_SECRET)
return {
token,
user,
}
}
IKelly
11/26/2018, 3:02 PMNovalis
11/26/2018, 3:08 PMNovalis
11/26/2018, 3:10 PMKelly
11/26/2018, 3:10 PMKelly
11/26/2018, 3:11 PMtype Mutation {
createNewsarticle(data: NewsarticleCreateInput!): Newsarticle!
createUser(data: UserCreateInput!): User!
Kelly
11/26/2018, 3:11 PMNovalis
11/26/2018, 3:12 PMtype UserCreateInput {
data {...}
}
in there. Need to see the contents of it 🙂Novalis
11/26/2018, 3:15 PMKelly
11/26/2018, 3:15 PMinput UserCreateInput {
name: String!
email: String!
password: String!
circuits: CircuitCreateManyWithoutAddedByInput
sends: SendCreateManyWithoutUserInput
homegym: GymCreateOneInput
}
Novalis
11/26/2018, 3:15 PMNovalis
11/26/2018, 3:19 PMNovalis
11/26/2018, 3:20 PMKelly
11/26/2018, 3:21 PMKelly
11/26/2018, 3:21 PMNovalis
11/26/2018, 3:22 PMKelly
11/26/2018, 3:25 PMNovalis
11/26/2018, 3:32 PMKelly
11/26/2018, 3:51 PM