From a3c43b10bcc5877f4603c735e9f8eaf153b306d6 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 27 Apr 2026 18:18:06 +0000 Subject: [PATCH] feat: add GraphQL lookup operations for resolver migration Refs #208 --- graphql/queries/initiatives.graphql | 13 ++------- graphql/queries/issues.graphql | 42 +++++++++++++++++++++++++++++ graphql/queries/labels.graphql | 8 ++++++ graphql/queries/projects.graphql | 17 ++++++++++++ graphql/queries/teams.graphql | 36 ++++++++++++++++++++++--- 5 files changed, 101 insertions(+), 15 deletions(-) diff --git a/graphql/queries/initiatives.graphql b/graphql/queries/initiatives.graphql index e3095af8..20affb42 100644 --- a/graphql/queries/initiatives.graphql +++ b/graphql/queries/initiatives.graphql @@ -165,17 +165,8 @@ query GetInitiativeUpdate($id: String!) { } } -query FindInitiativesByName($name: String!, $teamId: ID, $ownerId: ID) { - initiatives( - first: 20 - filter: { - and: [ - { name: { eqIgnoreCase: $name } } - { teams: { some: { id: { eq: $teamId } } } } - { owner: { id: { eq: $ownerId } } } - ] - } - ) { +query FindInitiativesByName($filter: InitiativeFilter!) { + initiatives(first: 20, filter: $filter) { nodes { ...InitiativeNameLookupFields } diff --git a/graphql/queries/issues.graphql b/graphql/queries/issues.graphql index 2afbf99e..0e743325 100644 --- a/graphql/queries/issues.graphql +++ b/graphql/queries/issues.graphql @@ -144,6 +144,23 @@ fragment CompleteIssueWithReactionsFields on Issue { } } +fragment WorkflowStateLookupFields on WorkflowState { + id + name + team { + id + key + name + } +} + +fragment IssueEstimateContextFields on Issue { + id + team { + ...TeamEstimateLookupFields + } +} + # Complete issue search fragment with all relationships # # Combines all issue fragments into a comprehensive field selection. @@ -323,6 +340,31 @@ query GetIssueTeam($issueId: String!) { } } +query FindWorkflowStates($filter: WorkflowStateFilter!) { + workflowStates(filter: $filter, first: 10) { + nodes { + ...WorkflowStateLookupFields + } + } +} + +query GetIssueEstimateContextById($id: String!) { + issue(id: $id) { + ...IssueEstimateContextFields + } +} + +query GetIssueEstimateContextByIdentifier($teamKey: String!, $number: Float!) { + issues( + filter: { team: { key: { eq: $teamKey } }, number: { eq: $number } } + first: 1 + ) { + nodes { + ...IssueEstimateContextFields + } + } +} + # Search issues with text search and all relationships in single query # # Provides full-text search across Linear issues with complete diff --git a/graphql/queries/labels.graphql b/graphql/queries/labels.graphql index 5759a84c..1457bb13 100644 --- a/graphql/queries/labels.graphql +++ b/graphql/queries/labels.graphql @@ -61,3 +61,11 @@ query GetProjectLabels($first: Int = 50, $after: String) { } } } + +query FindProjectLabelsByName($name: String!) { + projectLabels(filter: { name: { eqIgnoreCase: $name } }, first: 1) { + nodes { + ...ProjectLabelFields + } + } +} diff --git a/graphql/queries/projects.graphql b/graphql/queries/projects.graphql index 9b3e8a5f..1678c6e1 100644 --- a/graphql/queries/projects.graphql +++ b/graphql/queries/projects.graphql @@ -90,6 +90,11 @@ fragment ProjectDetailFields on Project { } } +fragment ProjectLookupFields on Project { + id + name +} + # List all projects in the workspace # # Fetches a paginated list of projects across all teams with enriched @@ -166,3 +171,15 @@ query GetProjectStatuses { } } } + +query FindProjectsByName($name: String!, $includeArchived: Boolean = false) { + projects( + filter: { name: { eqIgnoreCase: $name } } + first: 2 + includeArchived: $includeArchived + ) { + nodes { + ...ProjectLookupFields + } + } +} diff --git a/graphql/queries/teams.graphql b/graphql/queries/teams.graphql index f941bd33..458c6635 100644 --- a/graphql/queries/teams.graphql +++ b/graphql/queries/teams.graphql @@ -21,10 +21,17 @@ fragment TeamFields on Team { name } -fragment TeamDetailFields on Team { +fragment TeamEstimateLookupFields on Team { id key name + issueEstimationType + issueEstimationExtended + issueEstimationAllowZero +} + +fragment TeamDetailFields on Team { + ...TeamEstimateLookupFields description private timezone @@ -36,9 +43,6 @@ fragment TeamDetailFields on Team { key name } - issueEstimationType - issueEstimationExtended - issueEstimationAllowZero defaultIssueEstimate inheritIssueEstimation cyclesEnabled @@ -78,3 +82,27 @@ query GetTeamById($id: String!) { ...TeamDetailFields } } + +query FindTeamEstimateContextById($id: ID!) { + teams(filter: { id: { eq: $id } }, first: 1) { + nodes { + ...TeamEstimateLookupFields + } + } +} + +query FindTeamEstimateContextByKey($key: String!) { + teams(filter: { key: { eq: $key } }, first: 1) { + nodes { + ...TeamEstimateLookupFields + } + } +} + +query FindTeamEstimateContextByName($name: String!) { + teams(filter: { name: { eq: $name } }, first: 1) { + nodes { + ...TeamEstimateLookupFields + } + } +}