apollographql/apollo-link

apollo-link-http with the `useQuery` react hook is not handling 404s properly

Closed this issue · 1 comments

Expected Behavior

On a 404, the error property of the value returned from useQuery should be set and data should be undefined

Actual Behavior

The error property is undefined and data is set with a single property who's value is undefined.

A simple reproduction

query GetCallout($businessId: String!) {
  callout(businessId: $businessId)
    @rest(type: "Callout", path: "/businesses/{args.businessId}/callout/") {
    title
    url
  }
}

In the case of a 404:

{
  error: undefined,
  data: {
    callout: undefined
  }
}

I will happily set up a public facing repro if this issue is accepted as something that would be investigated.

If this is accepted, I can work on a PR