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

Getting full error response

May 6, 2020 at 5:56pm

Getting full error response

May 6, 2020 at 5:56pm
Is there a way to get the full error response from a REST mutation?
The server returns: { "statusCode": 400, "error": "Bad Request", "message": "Missing X" }
But in the try catch when I run the mutation, I can't access the message "Missing X".

May 6, 2020 at 6:34pm
I figured it out! The error is an instance of ApolloError, but the documentation isn't very good around this. The thrown error will contain error.networkError.result which will have our statusCode, error, and message.
Edited
  • reply
  • like

September 18, 2020 at 2:05pm
Did you figure out how to pass that through the chain? I can access it and kick it out in the onError but i want to access the message later in the subscription
  • reply
  • like