Skip to content

insights: `seriesCount` field does not fail whole gql query

Administrator requested to merge insights/insightViews-partial-error into main

Created by: leonore

tackles part of #38951

  • SeriesCount return value is made nullable
  • use errorPolicy: ’all' on insightViews queries in the webapp

nb. this isn't a catch-all fix, but this creates a blueprint if we are to add more fields to query in the future. I believe that right now SeriesCount is the only query that can fail in this way

some background:

graphql allows to return both data and errors in its response. however:

  • in graphql, if there is an error on a non-nullable field then its whole parent is errored (spec)

so if we make a field nullable we'll be able to get both data and errors. however that must still be handled correctly by the client.

  • the apollo client allows to set an error policy we can use (docs)

Test plan

The following test plan was ran on both main and commit c8524fee4662257ab218a7c08873c77dd613754a (parent of this PR which removed seriesCount and the issue)

  1. Test ’All insights’ page works, even when an individual insight errors
  2. Test a specific dashboard page works, even when an individual insight errors
  3. Test single-insight page works, even when the insight errors.

Screenshots:

before:

all insights dashboard single insight
Screenshot 2022-07-27 at 12 32 05 Screenshot 2022-07-27 at 12 32 01 Screenshot 2022-07-27 at 12 24 07

after:

all insights dashboard single insight
Screenshot 2022-07-27 at 12 29 04 Screenshot 2022-07-27 at 12 29 09 Screenshot 2022-07-27 at 12 28 53

Merge request reports

Loading