Mirrored from GitHub github.com/roostorg/coop

[Bug] Stop graphql-depth-limit crashes and related MRT/insights issues (#401) master

* [Bug] Stop graphql-depth-limit crashes and related MRT/insights issues - Wrap graphql-depth-limit so an undefined fragment in a query no longer crashes validation with a 500; log the offending operation name and let graphql-js's KnownFragmentNamesRule report the real error. - Short-circuit ManualReviewQueue.jobs(ids: []) so the MRT page doesn't open a Bull/Redis queue handle per reviewable queue on every load. - Guard flattenRuleExecutionSampleForCSV against null/array values so the rule insights samples table doesn't crash on Object.entries(null). * The hand-written RULES_QUERY references ...ConditionSetFields but only interpolates RULE_FIELDS_FRAGMENT, so refetchQueries: [{ query: RULES_QUERY }] sent a document with an undefined fragment and tripped the depth-limit crash on every rule mutation. Switching to refetchQueries by operation name uses the codegen-generated, self-contained document instead.


+185 -26
8 changed files