question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errorPolicy not working

See original GitHub issue

When setting errorPolicy to all. Neither errors nor data.X is in the response. Setting it to ignore, i get the partial data but no error, using the default configuration i get data.error but not query data.

Intended outcome: errorPolicy should behave as documented: Add a errors field next to data in case of an error

Actual outcome: There is neither errors nor response data

How to reproduce the issue: Create a graphql object like this:

const withDataAndErrors = graphql(QUERY_THAT_HAS_DATA_AND_ERRORS, {
  options: {
    errorPolicy: 'all'
  }
});

that query should return something like:

{
  "data": {...},
  "errors": [...]
}

Version

  • apollo-client@2.1.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
jbaxleyiiicommented, Feb 7, 2018

This is fixed on master and will be released this week 🌮

sorry about the delay here!

3reactions
Torsten85commented, Jan 4, 2018

@Matt-Dionis could you test my proposed solution and give some feedback if it is working as it should? Then I’ll make a pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Policy in Apollo Client React seems doesn't work - Help
1 I have a problem when test Apollo. When I try to query with apollo and graphql, i want response return error and...
Read more >
errorPolicy not working · Issue #1389 · apollographql/react ...
I'm a volunteer as are others, so we have to fix our own problems. I'm just now getting involved and trying to help...
Read more >
error Policy in Apollo Client React does'nt work - Stack Overflow
I faced the same issue with errorPolicy: 'all' , I only received the partial result inside onCompleted callback of useQuery , but no...
Read more >
Error Handling – Angular - GraphQL Code Generator
Much like fetchPolicy , errorPolicy allows you to control how GraphQL Errors from the server are sent to your UI code. By default,...
Read more >
Output error policies in Azure Stream Analytics | Microsoft Learn
Output data error handling policies apply only to data conversion errors that occur when the output event produced by a Stream Analytics job ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found