Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLError message doesn't display its value #1055

Closed
itaied246 opened this issue Oct 3, 2017 · 4 comments
Closed

GraphQLError message doesn't display its value #1055

itaied246 opened this issue Oct 3, 2017 · 4 comments

Comments

@itaied246
Copy link

Getting errors in graphql doesn't display the error's message value,
it writes [object Object] instead.

stackoverflow

graphql version: 0.11.3

@reconbot
Copy link

reconbot commented Oct 9, 2017

(you should copy your question here)

The error message is GraphQLError: Invalid value [object Object] you're probably passing the string [object Object] when you mean to pass the object. Or your schema has a string where you think it has an object, or you're passing an object when you should be passing a string. With out your schema, query, or roots I'm just guessing.

The graphql object has a few properties that wont automatically log. They do help debugging a ton however. error.path and error.stack are my favorite. You can see the full list of them in the error object source.

@leebyron leebyron closed this as completed Dec 7, 2017
@venkat4541
Copy link

I have been facing this issue for a while. I've seen that there's a thread on this on the Apollo client page but thought it is more of a GraphQL one.
apollographql/apollo-client#1812

I went through the response of @reconbot and the error object source but failed to understand how the error.message is being populated. If it is something that is explicitly thrown by my schema, I would be able to try change things but if it is an implicit GraphQL code that is converting a valid error message object to string and thus showing up as [object Object], I would like to bring it to the GraphQL developers' attention.

Please help me understand if I can fix it by changing something in my schema or if it is something else. Thanks.

@giraudvalentin
Copy link

any solution ?

@IvanGoncharov
Copy link
Member

@giraudvalentin Can you please try 14.0.0-rc.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants