Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Comments

Return readable error back to client#7

Open
farzd wants to merge 1 commit intoapollographql:masterfrom
farzd:master
Open

Return readable error back to client#7
farzd wants to merge 1 commit intoapollographql:masterfrom
farzd:master

Conversation

@farzd
Copy link

@farzd farzd commented Jul 18, 2017

Currently if theres an error its returning [Object object] back to the client, this would return stingified error. e.g

[{"message":"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory."}]

I'm sure where else utilises this error though 👎

@apollo-cla
Copy link

@farzd: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@farzd
Copy link
Author

farzd commented Jul 20, 2017

@Urigo

@julienvincent
Copy link

@farzd Preferably the error is also formatted properly. JSON.stringify(error, null, 2) would multi-line the text according to GraphiQL's default presentation.

Any feedback to getting this merged?

@farzd
Copy link
Author

farzd commented Aug 29, 2017

@julienvincent yeah cool, don't mind updating it but not sure if anyones maintaining this?

@julienvincent
Copy link

Agreed it does seem a bit stale. But it is on the Apollo org so someone will probably get around to looking at this PR eventually.

Assuming it does get merged, it might be nice to namespace the errors to follow the GraphQL response convention:

JSON.stringify({
  errors: error
}, null, 2)

Then again, subscriptions don't return events in a data namespace so perhaps that isn't necessary

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants