Loading
Expose source_type and source_link on DuoWorkflow GraphQL type
What does this MR do and why?
Exposes the two new database columns added in !247849 (merged) via the GraphQL API.
Adds to the DuoWorkflow GraphQL type:
sourceType(DuoWorkflowSourceTypeenum, nullable, experiment 19.4): the external system that initiated the session (e.g.SLACK). Backed by thesource_typesmallint enum column.sourceLink(String, nullable, experiment 19.4): the URL or deep link to the location where the session was triggered from. Backed by thesource_linktext column.
A new DuoWorkflowSourceType enum type is introduced, dynamically derived from the model's source_types hash so it stays in sync automatically as new values are added.
References
- DB columns added in: !247849 (merged)
Closes #627235 (closed)
How to set up and validate locally
- In a rails console, create a workflow with
source_typeandsource_linkset:w = Ai::DuoWorkflows::Workflow.last w.update_columns(source_type: 1, source_link: 'https://example.slack.com/archives/C123') - Query via GraphQL:
query workflowSources { duoWorkflowWorkflows(first: 10) { nodes { sourceType sourceLink } } } - Verify
sourceType: "SLACK"andsourceLink: "https://example.slack.com/archives/C123"are returned.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Roman Eisner