feat(adapter-linear): extract canonical Linear GraphQL queries + filter builders + response types#26
Merged
khaliqgant merged 3 commits intomainfrom Apr 26, 2026
Merged
Conversation
…er builders + response types Tracks relayfile-adapters#24 — one canonical home for Linear API knowledge so cloud route.ts, cloud apifallback, and sage nango-integrations syncs all consume the same queries instead of holding ~10 duplicate copies. New exports under @relayfile/adapter-linear: - LINEAR_LIST_ISSUES_QUERY, LINEAR_SEARCH_ISSUES_QUERY, LINEAR_GET_ISSUE_QUERY - LINEAR_LIST_PROJECTS_QUERY, LINEAR_LIST_COMMENTS_QUERY - LINEAR_LIST_TEAMS_QUERY, LINEAR_LIST_USERS_QUERY - LINEAR_LIST_MILESTONES_QUERY, LINEAR_LIST_ROADMAPS_QUERY - LINEAR_FETCH_ACTIVE_ISSUES_QUERY (the sage incremental sync filter) - Field-selection constants: LINEAR_ISSUE_FIELDS, _PROJECT_FIELDS, _COMMENT_FIELDS, _TEAM_FIELDS, _USER_FIELDS - buildLinearIssueFilter() + buildLinearProjectFilter() (loose params → typed Linear filter shape) - Response types: LinearIssueNode, LinearProjectNode, LinearCommentNode, LinearGraphqlResponse<T> Field selections are the UNION of what cloud + sage consumers read. Validated against: 1. Nango integration-templates for Linear (canonical baseline) 2. sage nango-integrations/linear-sage/syncs/*.ts (production-proven) 3. cloud packages/web/app/api/v1/linear/query/route.ts + apifallback (consumers) Live verification: Every query was POSTed through the real Nango proxy using sage NANGO_SECRET_KEY, with connection IDs dynamically discovered via nango.listConnections(). All queries returned non-error responses with the expected shape. Catches schema drift at extract time so we never publish a query that 422s in production. Version: minor bump (additive — new exports, no breaking changes). Follow-up PRs (tracked in relayfile-adapters#24): - cloud refactor: import from @relayfile/adapter-linear, drop local copies - sage refactor: same for nango-integrations/linear-sage/syncs/* Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of three extract PRs for relayfile-adapters#24. Adds a canonical Linear GraphQL queries + filter builders + response types module under .
Bump:
@relayfile/adapter-linearminor → 0.2.0.What changed
packages/linear/src/queries.tswith 10 canonical query strings, 5 reusable field-selection constants, 2 filter builders, and 4 response type definitions.packages/linear/src/index.ts.packages/linear/src/queries.test.tscovering snapshot, filter builder behaviour, and edge cases.Sources
nango-integrations/linear-sage/syncs/*.ts(production-proven shapes)packages/web/app/api/v1/linear/query/route.ts+ apifallback (consumers being consolidated)Live verification
Every query in this PR was POSTed through the real Nango proxy using sage NANGO_SECRET_KEY, with the connection ID dynamically discovered via nango.listConnections(). All queries returned non-error responses with the expected top-level shape. This catches schema drift at extract time.
Follow-up PRs
After this PR merges and
@relayfile/adapter-linear@0.2.0republishes:nango-integrations/linear-sage/syncs/*Validation
npm test --workspace @relayfile/adapter-lineargreentsc -p packages/linear/tsconfig.json --noEmitclean🤖 Generated with Claude Code