Skip to content

insights: support mutating insight data series in GraphQL

Created by: coury-clark

We need to support the following operations

  1. Edit search query
  2. Edit time scope
  3. Edit repository scope

For an insight that we are only storing metadata (frontend insight) we can consider editing these in place. For a backend insight we have to consider that "editing" fields such as a query is actually the act of changing the series to the new query and either executing a backfill or attaching an existing series. With that in mind, it might make sense to unify this operation to say that:

  1. If a series is "small" enough (and not referenced), we can delete it, create (or find) a new one with the appropriate information, and attach that series
  2. If a series is "big" (and not referenced) we would likely want to keep the calculated data.
  3. If a series is referenced, we would likely just detach the series and create the new one.

Obviously the definition of small and big here would play a part in how effective this is. This may be a value that needs to be tunable.

Additionally, this is predicated on the ability to take an input (query, repo scope, time scope, etc...) and produce a referencable series_id, which currently is only possible on the query field.