frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

GraphQL expected iterable err [9:42pm] #97

Closed frankcollins3 closed 1 year ago

frankcollins3 commented 1 year ago

attempting to do: create calendar part of app exactly as original did (which works). Doing so in useEffect -> axios.post('/graphql -> allUserData)

error: type Query { allUserData(users_id: Int!): [Data]! }

proposed approach: manually tested with a new addition into psql with INSERT INTO data VALUES () // then ran into a problem with redis because the cache didn't update with this information and was returning 1 data (with the new INSERT INTO data not included in cache)

1: now considering in the userSignup() query that takes sign up form data and adds a new user into the database: prisma.data.create() -> data corresponding to a date in a year like 1994 which would never be relevant to the app

outside of being created just to avoid the iterable error.

frankcollins3 commented 1 year ago
 let userDataRedis = await userDataRedisCheck(users_id)
  if (userDataRedis) {
    const allUserDataObject = PARSESERIALIZEDSTRING(userDataRedis)
    console.log("userData redis block", userDataRedis)

👍 return allUserDataObject }

👎 return userDataRedis // the graphQL query was returning the data without being parsed as JSON [10:09pm]