fix(linear): align tool outputs, queries, and pagination with API#3150
fix(linear): align tool outputs, queries, and pagination with API#3150waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR systematically aligns all Linear tool implementations with the Linear GraphQL API and SDK entity types. Key changes:
The changes ensure tools accurately reflect what the Linear API returns and accept, improving data completeness and enabling proper pagination across all list endpoints. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Block as Linear Block
participant Tool as Linear Tool
participant API as Linear GraphQL API
Note over User,API: Example: List Customer Statuses with Pagination
User->>Block: Request list_customer_statuses
Block->>Block: Coerce first param to Number
Block->>Tool: Pass params (first, after, accessToken)
Tool->>Tool: Build GraphQL query with pagination
Tool->>API: POST /graphql (first: 50, after: cursor)
API-->>Tool: Return nodes + pageInfo (hasNextPage, endCursor)
Tool->>Tool: Transform response with pageInfo
Tool-->>Block: Return {customerStatuses, pageInfo}
Block-->>User: Output results + pagination info
Note over User,API: Enhanced with SDK-aligned fields
User->>Block: Request create_customer_status
Block->>Tool: Pass params (name, color, displayName)
Note over Tool: displayName is input-only
Tool->>API: POST /graphql (create mutation)
API-->>Tool: Return status (without displayName)
Note over Tool: Output includes type, updatedAt
Tool-->>Block: Return SDK-aligned customerStatus
Block-->>User: Output complete entity
|
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/blocks/blocks/linear.ts
Line: 807:810
Comment:
**Pagination inputs typed as string**
`first`/`after` block params are defined as `type: 'short-input'`, which typically yields string values, but many Linear tools declare `first` as a `number` param and pass it straight into GraphQL (e.g. `variables.first: params.first || 50`). If `first` comes through as a non-empty string (e.g. `'10'`), `params.first || 50` will remain a string and GraphQL will reject it (`Int` expected). Consider switching `first` to a numeric input type (if available) or consistently coercing with `Number(params.first)` in every tool that uses `first`/`after`.
How can I resolve this? If you propose a fix, please make it concise. |
…s, add null guard
|
@greptile |
|
@cursor review |
Summary
Type of Change
Testing
Tested manually
Checklist