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

createRequestError: parse object messages to string #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajoslin
Copy link

@ajoslin ajoslin commented Mar 11, 2020

Before, error objects would come out of absinthe sockets as Error: request [object Object].

For example, these sort of GraphQL errors returned via socket:

{
  errors: [
    {
      locations: [Array],
      message: 'Fragment spread has no type overlap with parent.\n' +
        'Parent possible types: ["RootSubscriptionType"]\n' +
        'Spread possible types: ["User"]\n'
    }
  ]
}

Now, they'll show up as stringified JSON.

Error: request: {
  "errors": [
    {
      "locations": [
        {
          "column": 0,
          "line": 2
        }
      ],
      "message": "Fragment spread has no type overlap with parent.\nParent possible types: [\"RootSubscriptionType\"]\nSpread possible types: [\"User\"]\n"
    }
  ]
}

Before, error objects would come out of absinthe sockets as `request [object Object]`.

For example, these sort of GraphQL errors returned via socket:

```
{
  errors: [
    {
      locations: [Array],
      message: 'Fragment spread has no type overlap with parent.\n' +
        'Parent possible types: ["RootSubscriptionType"]\n' +
        'Spread possible types: ["User"]\n'
    }
  ]
}
```

Now, they'll show up as stringified JSON.
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

Successfully merging this pull request may close these issues.

1 participant