insights: support mutating insight data series in GraphQL
Created by: coury-clark
We need to support the following operations
- Edit search query
- Edit time scope
- 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:
- 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
- If a series is "big" (and not referenced) we would likely want to keep the calculated data.
- 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.