menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

`errorPolicy="all"` in the context of `result.error` vs `result.errors`

April 11, 2019 at 12:58am

`errorPolicy="all"` in the context of `result.error` vs `result.errors`

April 11, 2019 at 12:58am
I've been battling a bug in react-apollo's Query component that prevents onError from being called, and I've traced it back to ApolloClient not populating result.error when errorPolicy="all". I'm more than willing to file the PR for this, but I don't want to break the design intent around the all policy.
Modifying hasError to check policy === "all" should fix this, as it currently only checks none. This will also cause clients with policy all to more aggressively persist errors. I think this is the right call, but I would like to better understand the intent of all before I proceed.
Let me know if you disagree, I'm crazy or I missed something big. Thanks in advance! I left more details in the issue linked below. https://github.com/apollographql/apollo-client/issues/4644#issuecomment-481923356
No messages yet