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

not getting back data from {apollo-server-micro} resolver [10:52pm] #31

Closed frankcollins3 closed 12 months ago

frankcollins3 commented 12 months ago

attempting to do: idArgsReturnIcon: async (parent, args) => { const { users_id } = args return { icon: 4 } let allusers = await allusersDB() let me = allusers.filter(user => user.id === users_id)
// me = me[0]
let icon = me.icon ? me.icon : "/water_img/bite.png" return icon // return the icon }

error: before I was getting an "expecting name, got EOF (end of file) error from iterm2" fixed the EOF error by adding ending } to type Mutation {} // being confused on this error was part of problem but was solved.

Then, err: 👍 request went through 👎 but every endpoint was null

proposed approach: already solved. can't return icon as a string return {icon: icon}

the icon has to be returned as an object endpoint. in GraphQLHttp/GraphQLExpress this was not the case but this is no longer a react-express app it is a nextJS app.

tedious 30 minute issue.