Skip to content

createRequestError: parse object messages to string#46

Open
ajoslin wants to merge 1 commit intoabsinthe-graphql:masterfrom
ajoslin:patch-1
Open

createRequestError: parse object messages to string#46
ajoslin wants to merge 1 commit intoabsinthe-graphql:masterfrom
ajoslin:patch-1

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