Skip to content

insights: fix error response when updating insights due to missing pe…

Warren Gifford requested to merge insights/api/nil-response into main

Created by: coury-clark

Fixes https://github.com/sourcegraph/sourcegraph/issues/27837 Fixes https://github.com/sourcegraph/sourcegraph/issues/27906

Solves two problems that both contribute to an invalid response (nil) without an error in the GraphQL:

  1. Org permissions were not passed into the insight fetch after update. Now these will propagate from the higher level resolvers.
  2. There is a subtle bug where an empty list of insights would try to return err, but err in this case is nil. This results in a violation of the schema.

An example using the mutation provided in the issue above with this fix: CleanShot 2021-11-19 at 13 53 21@2x

Merge request reports

Loading