We are using Apollo Angular Client to call an Apollo Server. I am grouping together two queries. One of them fails.
On the server side, one of the resolvers throws an error.
throw new UserInputError("ERR_MSG", { "message":"addtional info"})
How am I supposed to handle the response on the client side when one of the calls fails? I want to use the data that worked from one query and show an error message for the data that failed.
this.apollo.watchQuery({
query: gql(query),
variables: { a: 'a' }
}).valueChanges.subscribe(
(response) => {
let a = resp.data?.Query1;
let b = resp.data?.Query2;
},
(err) => {
// always get here with only the one error
}
);
I'm not even sure if this is a server side issue or client side issue? I'm guessing I did something wrong SERVER SIDE because I don't even see the successful data passed back in the playground.