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.
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.