Closed frankcollins3 closed 1 year ago
problem: type Mutation { } was already added to graphql/schema.ts
solution: graphql/resolvers.ts: Mutation: {
[6:53pm]
don't have to reopen but forgot the UsersType: addUser( id: Int! google_id: String! icon: String! username: String! email: String! password: String! age: Int! ): Users }
[6:55pm]
next error in the process:
mutation {
addUser(
id: 4,
google_id: "no google-id",
icon: "/water_img/panda.png",
username: "lavaplace",
password: "lavaPassword123",
**email: lavaplace@gmail.com,** // email had no quotes and all of these strings had single quotes not double
age: 30
) {
id, google_id, icon, username, email, password, age
}
}
this works. It was either the email having no quotes or every other string key having single quotes only.
[6:56pm]
attempting to do: take a working graphQL query and implement it as a graphQL mutation
error:
proposed approach: when creating this app as a react-express app, there were no graphQL "mutations" but the app did mutate postgreSQL data and basically do graphQL mutations but within graphQL query resolvers()