Closed frankcollins3 closed 11 months ago
const returnLoginQuery = userLoginQueryStringFunc("tonyhawk@gmail.com", "birdman900"):
query {
userLogin(email: tonyhawk@gmail.com, password: birdman900 ) {
username,
password,
email,
age,
icon,
token
}
}
hand written query:
body: JSON.stringify({
query: `
query {
userLogin(email: "tonyhawk@gmail.com", password: "birdman900" ) {
username,
password,
email,
age,
icon,
token
}
}
`,
}),
})
[9:55am]
👎 query: query { ${returnLoginQuery} }
,
[9:59pm]
chatGPT pitched a hand they have to be wrapped in double quotes [10:07am]
attempting to do: take a working graphQL query and modularize it by: declaring it elsewhere in a func that takes the same {user & password} endpoints as params populates those into the query with string interpolation
error: Expected name, found @![Screen Shot 2023-07-18 at 9 47 37 AM](https://github.com/frankcollins3/Next-Water-App/assets/73137934/ce9c7a9f-128b-43f6-bcb7-b78b656668cd)
browser logs:![Screen Shot 2023-07-18 at 9 48 59 AM](https://github.com/frankcollins3/Next-Water-App/assets/73137934/276c1b15-c9f3-4297-974b-0b1dba9e1d3e)
proposed approach: 0: walk things back to an abstract definition of the params.
1: .log() the query and find discrepancy