insights: fix error response when updating insights due to missing pe…
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:
- Org permissions were not passed into the insight fetch after update. Now these will propagate from the higher level resolvers.
- There is a subtle bug where an empty list of insights would try to return
err
, buterr
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: