Open History to see the last commit
1// Generated by @effect/graphql-generator from LinearApi.graphql. Do not edit.
2import { GraphQL, GraphQLGroup } from "effect/graphql"
3import * as Schema from "effect/Schema"
4import * as Shared from "../../schema/linear.graphql.ts"
5
6/**
7 * `fragment LinearUser on User`
8 *
9 * A user that belongs to a workspace. Users can have different roles (admin, member, guest, or app) that determine their level of access. Users can be members of multiple teams, and can be active or deactivated. Guest users have limited access scoped to specific teams they are invited to.
10 */
11export const LinearUser = Schema.Struct({
12 /** The unique identifier of the entity. */
13 id: Shared.ID,
14 /** The user's full name. */
15 name: Schema.String,
16 /** The user's display (nick) name. Must be unique within the workspace. */
17 displayName: Schema.String,
18 /** The user's email address. */
19 email: Schema.String,
20 /** An URL to the user's avatar image. */
21 avatarUrl: Schema.NullOr(Schema.String)
22})
23export interface LinearUser extends Schema.Struct.Type<typeof LinearUser.fields> {}
24
25/**
26 * `fragment LinearBot on ActorBot`
27 *
28 * A bot actor representing a non-human entity that performed an action, such as an integration (GitHub, Slack, Zendesk), an AI assistant, or an automated workflow. Bot actors are displayed in activity feeds and history to indicate when changes were made by applications rather than users.
29 */
30export const LinearBot = Schema.Struct({
31 /** The display name of the bot. */
32 name: Schema.NullOr(Schema.String),
33 /** The display name of the external user on behalf of whom the bot acted. Shown when an integration action was triggered by a specific person in the external system. */
34 userDisplayName: Schema.NullOr(Schema.String),
35 /** A URL pointing to the avatar image representing this bot, typically the integration's logo or icon. */
36 avatarUrl: Schema.NullOr(Schema.String)
37})
38export interface LinearBot extends Schema.Struct.Type<typeof LinearBot.fields> {}
39
40/**
41 * `fragment LinearWorkflowState on WorkflowState`
42 *
43 * A state in a team's workflow, representing an issue status such as Triage, Backlog, Todo, In Progress, In Review, Done, or Canceled. Each team has its own set of workflow states that define the progression of issues through the team's process. Workflow states have a type that categorizes them (triage, backlog, unstarted, started, completed, canceled), a position that determines their display order, and a color for visual identification. States can be inherited from parent teams to sub-teams.
44 */
45export const LinearWorkflowState = Schema.Struct({
46 /** The unique identifier of the entity. */
47 id: Shared.ID,
48 /** The state's human-readable name (e.g., 'In Progress', 'Done', 'Backlog'). */
49 name: Schema.String,
50 /** The type of the state. One of "triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate". */
51 type: Schema.String,
52 /** The position of the state in the team's workflow. States are displayed in ascending order of position within their type group. */
53 position: Shared.Float
54})
55export interface LinearWorkflowState extends Schema.Struct.Type<typeof LinearWorkflowState.fields> {}
56
57/**
58 * `fragment LinearLabel on IssueLabel`
59 *
60 * Labels that can be associated with issues. Labels help categorize and filter issues across a workspace. They can be workspace-level (shared across all teams) or team-scoped. Labels have a color for visual identification and can be organized hierarchically into groups, where a parent label acts as a group containing child labels. Labels may also be inherited from parent teams to sub-teams.
61 */
62export const LinearLabel = Schema.Struct({
63 /** The unique identifier of the entity. */
64 id: Shared.ID,
65 /** The label's name. */
66 name: Schema.String,
67 /** The label's color as a HEX string (e.g., '#EB5757'). Used for visual identification of the label in the UI. */
68 color: Schema.String
69})
70export interface LinearLabel extends Schema.Struct.Type<typeof LinearLabel.fields> {}
71
72/**
73 * `fragment LinearTeamLabel on IssueLabel`
74 *
75 * Labels that can be associated with issues. Labels help categorize and filter issues across a workspace. They can be workspace-level (shared across all teams) or team-scoped. Labels have a color for visual identification and can be organized hierarchically into groups, where a parent label acts as a group containing child labels. Labels may also be inherited from parent teams to sub-teams.
76 */
77export const LinearTeamLabel = Schema.Struct({
78 ...LinearLabel.fields,
79 /** The label's description. */
80 description: Schema.NullOr(Schema.String)
81})
82export interface LinearTeamLabel extends Schema.Struct.Type<typeof LinearTeamLabel.fields> {}
83
84/**
85 * `fragment LinearReaction on Reaction`
86 *
87 * An emoji reaction on a comment, issue, project update, initiative update, post, pull request, or pull request comment. Each reaction is associated with exactly one parent entity and is created by either a workspace user or an external user. Reactions are persisted individually but surfaced on their parent entities as aggregated reactionData.
88 */
89export const LinearReaction = Schema.Struct({
90 /** The unique identifier of the entity. */
91 id: Shared.ID,
92 /** The name of the emoji used for this reaction. For custom workspace emojis, this is the custom emoji name; for standard emojis, this is the normalized emoji name. */
93 emoji: Schema.String,
94 /** The workspace user that created the reaction. Null if the reaction was created by an external user through an integration. */
95 user: Schema.NullOr(LinearUser)
96})
97export interface LinearReaction extends Schema.Struct.Type<typeof LinearReaction.fields> {}
98
99/**
100 * `fragment LinearComment on Comment`
101 *
102 * A comment associated with an issue, project update, initiative update, document content, post, project, or initiative. Comments support rich text (ProseMirror), emoji reactions, and threaded replies via parentId. Comments can be created by workspace users or by external users through integrations (e.g., Slack, Intercom). Each comment belongs to exactly one parent entity.
103 */
104export const LinearComment = Schema.Struct({
105 /** The unique identifier of the entity. */
106 id: Shared.ID,
107 /** The comment content in markdown format. This is a derived representation of the canonical bodyData ProseMirror content. */
108 body: Schema.String,
109 /** The time at which the entity was created. */
110 createdAt: Shared.DateTime,
111 /** Comment's URL. */
112 url: Schema.String,
113 /** The user who wrote the comment. Null for comments created by integrations or bots without a user association. */
114 user: Schema.NullOr(LinearUser),
115 /** The bot that created the comment. */
116 botActor: Schema.NullOr(LinearBot),
117 /** Reactions associated with the comment. */
118 reactions: Schema.Array(LinearReaction)
119})
120export interface LinearComment extends Schema.Struct.Type<typeof LinearComment.fields> {}
121
122/** A team is the primary organizational unit in Linear. Issues belong to teams, and each team has its own workflow states, cycles, labels, and settings. Teams can be public (visible to all workspace members), private (visible only to team members), or restricted (visible only within an enclosing private-team boundary). Teams can also have sub-teams that inherit settings from their parent. */
123export const LinearIssueTeamTeam = Schema.Struct({
124 /** The team's unique key, used as a prefix in issue identifiers (e.g., 'ENG' in 'ENG-123') and in URLs. */
125 key: Schema.String
126})
127export interface LinearIssueTeamTeam extends Schema.Struct.Type<typeof LinearIssueTeamTeam.fields> {}
128
129export const LinearIssueLabelsIssueLabelConnection = Schema.Struct({
130 nodes: Schema.Array(LinearLabel)
131})
132export interface LinearIssueLabelsIssueLabelConnection extends Schema.Struct.Type<typeof LinearIssueLabelsIssueLabelConnection.fields> {}
133
134/**
135 * `fragment LinearIssue on Issue`
136 *
137 * An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes.
138 */
139export const LinearIssue = Schema.Struct({
140 /** The unique identifier of the entity. */
141 id: Shared.ID,
142 /** Issue's human readable identifier (e.g. ENG-123). */
143 identifier: Schema.String,
144 /** The issue's unique number, scoped to the issue's team. Together with the team key, this forms the issue's human-readable identifier (e.g., ENG-123). */
145 number: Shared.Float,
146 /** The issue's title. This is the primary human-readable summary of the work item. */
147 title: Schema.String,
148 /** Issue URL. */
149 url: Schema.String,
150 /** The issue's description in markdown format. */
151 description: Schema.NullOr(Schema.String),
152 /** The time at which the entity was created. */
153 createdAt: Shared.DateTime,
154 /**
155 * The last time at which the entity was meaningfully updated. This is the same as the creation time if the entity hasn't
156 * been updated after creation.
157 */
158 updatedAt: Shared.DateTime,
159 /** The time at which the issue was moved into completed state. */
160 completedAt: Schema.NullOr(Shared.DateTime),
161 /** The time at which the issue was moved into canceled state. */
162 canceledAt: Schema.NullOr(Shared.DateTime),
163 /** The workflow state (issue status) that the issue is currently in. Workflow states represent the issue's progress through the team's workflow, such as Triage, Todo, In Progress, Done, or Canceled. */
164 state: LinearWorkflowState,
165 /** The team that the issue belongs to. Every issue must belong to exactly one team, which determines the available workflow states, labels, and other team-specific configuration. */
166 team: LinearIssueTeamTeam,
167 /** The user who created the issue. Null if the creator's account has been deleted or if the issue was created by an integration or system process. */
168 creator: Schema.NullOr(LinearUser),
169 /** The bot that created the issue, if applicable. */
170 botActor: Schema.NullOr(LinearBot),
171 /** The user to whom the issue is assigned. Null if the issue is unassigned. */
172 assignee: Schema.NullOr(LinearUser),
173 /** Labels associated with this issue. */
174 labels: LinearIssueLabelsIssueLabelConnection
175})
176export interface LinearIssue extends Schema.Struct.Type<typeof LinearIssue.fields> {}
177
178/** `fragment LinearPageInfo on PageInfo` */
179export const LinearPageInfo = Schema.Struct({
180 /** Indicates if there are more results when paginating forward. */
181 hasNextPage: Schema.Boolean,
182 /** Cursor representing the last result in the paginated results. */
183 endCursor: Schema.NullOr(Schema.String)
184})
185export interface LinearPageInfo extends Schema.Struct.Type<typeof LinearPageInfo.fields> {}
186
187/** A workspace (referred to as Organization in the API). Workspaces are the root-level container for all teams, users, projects, issues, and settings. Every user belongs to at least one workspace, and all data is scoped within a workspace boundary. */
188export const Organization = Schema.Struct({
189 /** The workspace's unique URL key, used in URLs to identify the workspace. */
190 urlKey: Schema.String
191})
192export interface Organization extends Schema.Struct.Type<typeof Organization.fields> {}
193
194/** A team is the primary organizational unit in Linear. Issues belong to teams, and each team has its own workflow states, cycles, labels, and settings. Teams can be public (visible to all workspace members), private (visible only to team members), or restricted (visible only within an enclosing private-team boundary). Teams can also have sub-teams that inherit settings from their parent. */
195export const T3ViewerTeamsNodesTeam = Schema.Struct({
196 /** The unique identifier of the entity. */
197 id: Shared.ID,
198 /** The team's unique key, used as a prefix in issue identifiers (e.g., 'ENG' in 'ENG-123') and in URLs. */
199 key: Schema.String,
200 /** The team's name. */
201 name: Schema.String
202})
203export interface T3ViewerTeamsNodesTeam extends Schema.Struct.Type<typeof T3ViewerTeamsNodesTeam.fields> {}
204
205export const T3ViewerTeamsTeamConnection = Schema.Struct({
206 nodes: Schema.Array(T3ViewerTeamsNodesTeam)
207})
208export interface T3ViewerTeamsTeamConnection extends Schema.Struct.Type<typeof T3ViewerTeamsTeamConnection.fields> {}
209
210/** `query T3Viewer` */
211export const T3Viewer = GraphQL.query("T3Viewer", {
212 document: {
213 variables: [],
214 selections: [
215 { name: "viewer", body: ["{...LinearUser}"] },
216 { name: "organization", body: ["{urlKey}"] },
217 { name: "teams", body: ["(first:250){nodes{id key name}}"] }
218 ],
219 fragments: [
220 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] }
221 ]
222 },
223 result: Schema.Struct({
224 /** The currently authenticated user making the API request. */
225 viewer: LinearUser,
226 /** The authenticated user's workspace. */
227 organization: Organization,
228 /** All teams whose issues the user can access. This includes public teams and private teams the user is a member of. This may differ from `administrableTeams`, which returns teams whose settings the user can change but whose issues they don't necessarily have access to. */
229 teams: T3ViewerTeamsTeamConnection
230 })
231})
232export declare namespace T3Viewer {
233 export type Variables = typeof T3Viewer.variables.Type
234 export type Result = typeof T3Viewer.result.Type
235}
236
237export const IssueConnection = Schema.Struct({
238 nodes: Schema.Array(LinearIssue),
239 pageInfo: LinearPageInfo
240})
241export interface IssueConnection extends Schema.Struct.Type<typeof IssueConnection.fields> {}
242
243/** `query T3Issues` */
244export const T3Issues = GraphQL.query("T3Issues", {
245 document: {
246 variables: [
247 { name: "first", body: "Int!" },
248 { name: "after", body: "String" },
249 { name: "filter", body: "IssueFilter!" },
250 { name: "orderBy", body: "PaginationOrderBy!" }
251 ],
252 selections: [
253 { name: "issues", body: ["(first:$", "first", " after:$", "after", " filter:$", "filter", " orderBy:$", "orderBy", "){nodes{...LinearIssue}pageInfo{...LinearPageInfo}}"] }
254 ],
255 fragments: [
256 { name: "LinearIssue", body: ["on Issue{id identifier number title url description createdAt updatedAt completedAt canceledAt state{...LinearWorkflowState}team{key}creator{...LinearUser}botActor{...LinearBot}assignee{...LinearUser}labels{nodes{...LinearLabel}}}"] },
257 { name: "LinearPageInfo", body: ["on PageInfo{hasNextPage endCursor}"] },
258 { name: "LinearWorkflowState", body: ["on WorkflowState{id name type position}"] },
259 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] },
260 { name: "LinearBot", body: ["on ActorBot{name userDisplayName avatarUrl}"] },
261 { name: "LinearLabel", body: ["on IssueLabel{id name color}"] }
262 ]
263 },
264 variables: {
265 first: Shared.Int,
266 after: Schema.optional(Schema.NullOr(Schema.String)),
267 filter: Shared.IssueFilter,
268 orderBy: Shared.PaginationOrderBy
269 },
270 result: Schema.Struct({
271 /** All issues. Returns a paginated list of issues visible to the authenticated user. Can be filtered by various criteria including team, assignee, state, labels, project, and cycle. */
272 issues: IssueConnection
273 })
274})
275export declare namespace T3Issues {
276 export type Variables = typeof T3Issues.variables.Type
277 export type Result = typeof T3Issues.result.Type
278}
279
280export const TeamStatesWorkflowStateConnection = Schema.Struct({
281 nodes: Schema.Array(LinearWorkflowState)
282})
283export interface TeamStatesWorkflowStateConnection extends Schema.Struct.Type<typeof TeamStatesWorkflowStateConnection.fields> {}
284
285/** A team is the primary organizational unit in Linear. Issues belong to teams, and each team has its own workflow states, cycles, labels, and settings. Teams can be public (visible to all workspace members), private (visible only to team members), or restricted (visible only within an enclosing private-team boundary). Teams can also have sub-teams that inherit settings from their parent. */
286export const IssueTeamTeam = Schema.Struct({
287 /** The team's unique key, used as a prefix in issue identifiers (e.g., 'ENG' in 'ENG-123') and in URLs. */
288 key: Schema.String,
289 /** The states that define the workflow associated with the team. */
290 states: TeamStatesWorkflowStateConnection
291})
292export interface IssueTeamTeam extends Schema.Struct.Type<typeof IssueTeamTeam.fields> {}
293
294export const CommentConnection = Schema.Struct({
295 nodes: Schema.Array(LinearComment),
296 pageInfo: LinearPageInfo
297})
298export interface CommentConnection extends Schema.Struct.Type<typeof CommentConnection.fields> {}
299
300/** An attachment linking external content to an issue. Attachments represent connections to external resources such as GitHub pull requests, Slack messages, Zendesk tickets, Figma files, Sentry issues, Intercom conversations, and plain URLs. Each attachment has a title and subtitle displayed in the Linear UI, a URL serving as both the link destination and unique identifier per issue, and optional metadata specific to the source integration. */
301export const Attachment = Schema.Struct({
302 /** The URL of the external resource this attachment links to. Also serves as a unique identifier for the attachment within an issue; no two attachments on the same issue can share the same URL. */
303 url: Schema.String,
304 /** Content for the title line in the Linear attachment widget. */
305 title: Schema.String,
306 /** The source type of the attachment, derived from the source metadata. Returns the integration type (e.g., 'github', 'slack', 'zendesk') or 'unknown' if no source is set. */
307 sourceType: Schema.NullOr(Schema.String),
308 /** Integration-specific metadata for this attachment. The schema varies by source type and may include fields such as pull request status, review counts, commit information, ticket status, or other data from the external system. */
309 metadata: Shared.JSONObject
310})
311export interface Attachment extends Schema.Struct.Type<typeof Attachment.fields> {}
312
313export const AttachmentConnection = Schema.Struct({
314 nodes: Schema.Array(Attachment)
315})
316export interface AttachmentConnection extends Schema.Struct.Type<typeof AttachmentConnection.fields> {}
317
318/** A record of changes to an issue. Each history entry captures one or more property changes made to an issue within a short grouping window by the same actor. History entries track changes to fields such as title, assignee, status, priority, project, cycle, labels, due date, estimate, parent issue, and more. They also record metadata about what triggered the change (e.g., a user action, workflow automation, triage rule, or integration). */
319export const IssueHistory = Schema.Struct({
320 /** The unique identifier of the entity. */
321 id: Shared.ID,
322 /** The time at which the entity was created. */
323 createdAt: Shared.DateTime,
324 /** The actor that performed the actions. This field may be empty in the case of integrations or automations. */
325 actor: Schema.NullOr(LinearUser),
326 /** The bot that performed the action. */
327 botActor: Schema.NullOr(LinearBot),
328 /** The state that the issue was moved from. */
329 fromState: Schema.NullOr(LinearWorkflowState),
330 /** The state that the issue was moved to. */
331 toState: Schema.NullOr(LinearWorkflowState),
332 /** The user that was unassigned from the issue. */
333 fromAssignee: Schema.NullOr(LinearUser),
334 /** The user that was assigned to the issue. */
335 toAssignee: Schema.NullOr(LinearUser),
336 /** The labels that were added to the issue. */
337 addedLabels: Schema.NullOr(Schema.Array(LinearLabel)),
338 /** The labels that were removed from the issue. */
339 removedLabels: Schema.NullOr(Schema.Array(LinearLabel)),
340 /** What the title was changed from. */
341 fromTitle: Schema.NullOr(Schema.String),
342 /** What the title was changed to. */
343 toTitle: Schema.NullOr(Schema.String)
344})
345export interface IssueHistory extends Schema.Struct.Type<typeof IssueHistory.fields> {}
346
347export const IssueHistoryConnection = Schema.Struct({
348 nodes: Schema.Array(IssueHistory)
349})
350export interface IssueHistoryConnection extends Schema.Struct.Type<typeof IssueHistoryConnection.fields> {}
351
352/** An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes. */
353export const T3IssueIssueIssue = Schema.Struct({
354 /** The unique identifier of the entity. */
355 id: Shared.ID,
356 /** Issue's human readable identifier (e.g. ENG-123). */
357 identifier: Schema.String,
358 /** The issue's unique number, scoped to the issue's team. Together with the team key, this forms the issue's human-readable identifier (e.g., ENG-123). */
359 number: Shared.Float,
360 /** The issue's title. This is the primary human-readable summary of the work item. */
361 title: Schema.String,
362 /** Issue URL. */
363 url: Schema.String,
364 /** The issue's description in markdown format. */
365 description: Schema.NullOr(Schema.String),
366 /** The time at which the entity was created. */
367 createdAt: Shared.DateTime,
368 /**
369 * The last time at which the entity was meaningfully updated. This is the same as the creation time if the entity hasn't
370 * been updated after creation.
371 */
372 updatedAt: Shared.DateTime,
373 /** The time at which the issue was moved into completed state. */
374 completedAt: Schema.NullOr(Shared.DateTime),
375 /** The time at which the issue was moved into canceled state. */
376 canceledAt: Schema.NullOr(Shared.DateTime),
377 /** The workflow state (issue status) that the issue is currently in. Workflow states represent the issue's progress through the team's workflow, such as Triage, Todo, In Progress, Done, or Canceled. */
378 state: LinearWorkflowState,
379 /** The team that the issue belongs to. Every issue must belong to exactly one team, which determines the available workflow states, labels, and other team-specific configuration. */
380 team: IssueTeamTeam,
381 /** The user who created the issue. Null if the creator's account has been deleted or if the issue was created by an integration or system process. */
382 creator: Schema.NullOr(LinearUser),
383 /** The bot that created the issue, if applicable. */
384 botActor: Schema.NullOr(LinearBot),
385 /** The user to whom the issue is assigned. Null if the issue is unassigned. */
386 assignee: Schema.NullOr(LinearUser),
387 /** Labels associated with this issue. */
388 labels: LinearIssueLabelsIssueLabelConnection,
389 /** Comments associated with the issue, including inline comments on the issue's description. */
390 comments: CommentConnection,
391 /** Reactions associated with the issue. */
392 reactions: Schema.Array(LinearReaction),
393 /** Attachments associated with the issue. */
394 attachments: AttachmentConnection,
395 /** History entries associated with the issue. */
396 history: IssueHistoryConnection
397})
398export interface T3IssueIssueIssue extends Schema.Struct.Type<typeof T3IssueIssueIssue.fields> {}
399
400/** `query T3Issue` */
401export const T3Issue = GraphQL.query("T3Issue", {
402 document: {
403 variables: [
404 { name: "id", body: "String!" },
405 { name: "comments", body: "Int!" }
406 ],
407 selections: [
408 { name: "issue", body: ["(id:$", "id", "){...LinearIssue team{states(first:100){nodes{...LinearWorkflowState}}}comments(first:$", "comments", " orderBy:createdAt){nodes{...LinearComment}pageInfo{...LinearPageInfo}}reactions{...LinearReaction}attachments(first:50){nodes{url title sourceType metadata}}history(first:100 orderBy:createdAt){nodes{id createdAt actor{...LinearUser}botActor{...LinearBot}fromState{...LinearWorkflowState}toState{...LinearWorkflowState}fromAssignee{...LinearUser}toAssignee{...LinearUser}addedLabels{...LinearLabel}removedLabels{...LinearLabel}fromTitle toTitle}}}"] }
409 ],
410 fragments: [
411 { name: "LinearIssue", body: ["on Issue{id identifier number title url description createdAt updatedAt completedAt canceledAt state{...LinearWorkflowState}team{key}creator{...LinearUser}botActor{...LinearBot}assignee{...LinearUser}labels{nodes{...LinearLabel}}}"] },
412 { name: "LinearWorkflowState", body: ["on WorkflowState{id name type position}"] },
413 { name: "LinearComment", body: ["on Comment{id body createdAt url user{...LinearUser}botActor{...LinearBot}reactions{...LinearReaction}}"] },
414 { name: "LinearPageInfo", body: ["on PageInfo{hasNextPage endCursor}"] },
415 { name: "LinearReaction", body: ["on Reaction{id emoji user{...LinearUser}}"] },
416 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] },
417 { name: "LinearBot", body: ["on ActorBot{name userDisplayName avatarUrl}"] },
418 { name: "LinearLabel", body: ["on IssueLabel{id name color}"] }
419 ]
420 },
421 variables: {
422 id: Schema.String,
423 comments: Shared.Int
424 },
425 result: Schema.Struct({
426 /** One specific issue, looked up by its unique identifier. */
427 issue: T3IssueIssueIssue
428 })
429})
430export declare namespace T3Issue {
431 export type Variables = typeof T3Issue.variables.Type
432 export type Result = typeof T3Issue.result.Type
433}
434
435/** An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes. */
436export const T3CommentsIssueIssue = Schema.Struct({
437 /** Comments associated with the issue, including inline comments on the issue's description. */
438 comments: CommentConnection
439})
440export interface T3CommentsIssueIssue extends Schema.Struct.Type<typeof T3CommentsIssueIssue.fields> {}
441
442/** `query T3Comments` */
443export const T3Comments = GraphQL.query("T3Comments", {
444 document: {
445 variables: [
446 { name: "id", body: "String!" },
447 { name: "first", body: "Int!" },
448 { name: "after", body: "String" }
449 ],
450 selections: [
451 { name: "issue", body: ["(id:$", "id", "){comments(first:$", "first", " after:$", "after", " orderBy:createdAt){nodes{...LinearComment}pageInfo{...LinearPageInfo}}}"] }
452 ],
453 fragments: [
454 { name: "LinearComment", body: ["on Comment{id body createdAt url user{...LinearUser}botActor{...LinearBot}reactions{...LinearReaction}}"] },
455 { name: "LinearPageInfo", body: ["on PageInfo{hasNextPage endCursor}"] },
456 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] },
457 { name: "LinearBot", body: ["on ActorBot{name userDisplayName avatarUrl}"] },
458 { name: "LinearReaction", body: ["on Reaction{id emoji user{...LinearUser}}"] }
459 ]
460 },
461 variables: {
462 id: Schema.String,
463 first: Shared.Int,
464 after: Schema.optional(Schema.NullOr(Schema.String))
465 },
466 result: Schema.Struct({
467 /** One specific issue, looked up by its unique identifier. */
468 issue: T3CommentsIssueIssue
469 })
470})
471export declare namespace T3Comments {
472 export type Variables = typeof T3Comments.variables.Type
473 export type Result = typeof T3Comments.result.Type
474}
475
476export const NodesStatesWorkflowStateConnection = Schema.Struct({
477 nodes: Schema.Array(LinearWorkflowState),
478 pageInfo: LinearPageInfo
479})
480export interface NodesStatesWorkflowStateConnection extends Schema.Struct.Type<typeof NodesStatesWorkflowStateConnection.fields> {}
481
482export const NodesLabelsIssueLabelConnection = Schema.Struct({
483 nodes: Schema.Array(LinearTeamLabel),
484 pageInfo: LinearPageInfo
485})
486export interface NodesLabelsIssueLabelConnection extends Schema.Struct.Type<typeof NodesLabelsIssueLabelConnection.fields> {}
487
488export const UserConnection = Schema.Struct({
489 nodes: Schema.Array(LinearUser),
490 pageInfo: LinearPageInfo
491})
492export interface UserConnection extends Schema.Struct.Type<typeof UserConnection.fields> {}
493
494/** A reusable template for creating issues, projects, or documents. Templates store pre-filled field values and content as JSON data. They can be scoped to a specific team or shared across the entire workspace. Team-scoped templates may be inherited from parent teams. */
495export const Template = Schema.Struct({
496 /** The unique identifier of the entity. */
497 id: Shared.ID,
498 /** The name of the template. */
499 name: Schema.String,
500 /** A description of what the template is used for. */
501 description: Schema.NullOr(Schema.String),
502 /** The template's content in markdown format: the body it pre-fills on the entity it creates. Distinct from `description`, which says what the template is for. Form templates serialize their form fields as markdown placeholders instead. Null when the template has no content. */
503 content: Schema.NullOr(Schema.String),
504 /** The entity type this template is for, such as 'issue', 'project', or 'document'. */
505 type: Schema.String,
506 /** [Internal] Whether the template has form fields */
507 hasFormFields: Schema.Boolean,
508 /** The template data as a JSON-encoded string containing the pre-filled attributes for the entity type (e.g., issue fields, project configuration, or document content). */
509 templateData: Shared.JSON
510})
511export interface Template extends Schema.Struct.Type<typeof Template.fields> {}
512
513export const TemplateConnection = Schema.Struct({
514 nodes: Schema.Array(Template)
515})
516export interface TemplateConnection extends Schema.Struct.Type<typeof TemplateConnection.fields> {}
517
518/** A team is the primary organizational unit in Linear. Issues belong to teams, and each team has its own workflow states, cycles, labels, and settings. Teams can be public (visible to all workspace members), private (visible only to team members), or restricted (visible only within an enclosing private-team boundary). Teams can also have sub-teams that inherit settings from their parent. */
519export const T3TeamTeamsNodesTeam = Schema.Struct({
520 /** The unique identifier of the entity. */
521 id: Shared.ID,
522 /** The team's unique key, used as a prefix in issue identifiers (e.g., 'ENG' in 'ENG-123') and in URLs. */
523 key: Schema.String,
524 /** The team's name. */
525 name: Schema.String,
526 /** The states that define the workflow associated with the team. */
527 states: NodesStatesWorkflowStateConnection,
528 /** Labels associated with the team. */
529 labels: NodesLabelsIssueLabelConnection,
530 /** Users who are members of this team. Supports filtering and pagination. */
531 members: UserConnection,
532 /** Templates associated with the team. */
533 templates: TemplateConnection
534})
535export interface T3TeamTeamsNodesTeam extends Schema.Struct.Type<typeof T3TeamTeamsNodesTeam.fields> {}
536
537export const T3TeamTeamsTeamConnection = Schema.Struct({
538 nodes: Schema.Array(T3TeamTeamsNodesTeam)
539})
540export interface T3TeamTeamsTeamConnection extends Schema.Struct.Type<typeof T3TeamTeamsTeamConnection.fields> {}
541
542/** `query T3Team` */
543export const T3Team = GraphQL.query("T3Team", {
544 document: {
545 variables: [
546 { name: "key", body: "String!" }
547 ],
548 selections: [
549 { name: "teams", body: ["(first:1 filter:{key:{eq:$", "key", "}}){nodes{id key name states(first:100){nodes{...LinearWorkflowState}pageInfo{...LinearPageInfo}}labels(first:250){nodes{...LinearTeamLabel}pageInfo{...LinearPageInfo}}members(first:250){nodes{...LinearUser}pageInfo{...LinearPageInfo}}templates{nodes{id name description content type hasFormFields templateData}}}}"] },
550 { name: "issueLabels", body: ["(first:250 filter:{team:{null:true}}){nodes{...LinearTeamLabel}pageInfo{...LinearPageInfo}}"] }
551 ],
552 fragments: [
553 { name: "LinearWorkflowState", body: ["on WorkflowState{id name type position}"] },
554 { name: "LinearPageInfo", body: ["on PageInfo{hasNextPage endCursor}"] },
555 { name: "LinearTeamLabel", body: ["on IssueLabel{...LinearLabel description}"] },
556 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] },
557 { name: "LinearLabel", body: ["on IssueLabel{id name color}"] }
558 ]
559 },
560 variables: {
561 key: Schema.String
562 },
563 result: Schema.Struct({
564 /** All teams whose issues the user can access. This includes public teams and private teams the user is a member of. This may differ from `administrableTeams`, which returns teams whose settings the user can change but whose issues they don't necessarily have access to. */
565 teams: T3TeamTeamsTeamConnection,
566 /** All issue labels. Returns a paginated list of labels visible to the authenticated user, including both workspace-level and team-scoped labels. */
567 issueLabels: NodesLabelsIssueLabelConnection
568 })
569})
570export declare namespace T3Team {
571 export type Variables = typeof T3Team.variables.Type
572 export type Result = typeof T3Team.result.Type
573}
574
575/** An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes. */
576export const IssueCreateIssueIssue = Schema.Struct({
577 /** Issue's human readable identifier (e.g. ENG-123). */
578 identifier: Schema.String,
579 /** Issue URL. */
580 url: Schema.String
581})
582export interface IssueCreateIssueIssue extends Schema.Struct.Type<typeof IssueCreateIssueIssue.fields> {}
583
584/** The result of an issue mutation, containing the created or updated issue and a success indicator. */
585export const IssueCreateIssuePayload = Schema.Struct({
586 /** Whether the operation was successful. */
587 success: Schema.Boolean,
588 /** The issue that was created or updated. */
589 issue: Schema.NullOr(IssueCreateIssueIssue)
590})
591export interface IssueCreateIssuePayload extends Schema.Struct.Type<typeof IssueCreateIssuePayload.fields> {}
592
593/** `mutation T3IssueCreate` */
594export const T3IssueCreate = GraphQL.mutation("T3IssueCreate", {
595 document: {
596 variables: [
597 { name: "input", body: "IssueCreateInput!" }
598 ],
599 selections: [
600 { name: "issueCreate", body: ["(input:$", "input", "){success issue{identifier url}}"] }
601 ],
602 fragments: []
603 },
604 variables: {
605 input: Shared.IssueCreateInput
606 },
607 result: Schema.Struct({
608 /** Creates a new issue. */
609 issueCreate: IssueCreateIssuePayload
610 })
611})
612export declare namespace T3IssueCreate {
613 export type Variables = typeof T3IssueCreate.variables.Type
614 export type Result = typeof T3IssueCreate.result.Type
615}
616
617/** The result of an issue mutation, containing the created or updated issue and a success indicator. */
618export const IssueUpdateIssuePayload = Schema.Struct({
619 /** Whether the operation was successful. */
620 success: Schema.Boolean
621})
622export interface IssueUpdateIssuePayload extends Schema.Struct.Type<typeof IssueUpdateIssuePayload.fields> {}
623
624/** `mutation T3IssueUpdate` */
625export const T3IssueUpdate = GraphQL.mutation("T3IssueUpdate", {
626 document: {
627 variables: [
628 { name: "id", body: "String!" },
629 { name: "input", body: "IssueUpdateInput!" }
630 ],
631 selections: [
632 { name: "issueUpdate", body: ["(id:$", "id", " input:$", "input", "){success}"] }
633 ],
634 fragments: []
635 },
636 variables: {
637 id: Schema.String,
638 input: Shared.IssueUpdateInput
639 },
640 result: Schema.Struct({
641 /** Updates an issue. */
642 issueUpdate: IssueUpdateIssuePayload
643 })
644})
645export declare namespace T3IssueUpdate {
646 export type Variables = typeof T3IssueUpdate.variables.Type
647 export type Result = typeof T3IssueUpdate.result.Type
648}
649
650/** The result of a comment mutation. */
651export const CommentPayload = Schema.Struct({
652 /** Whether the operation was successful. */
653 success: Schema.Boolean
654})
655export interface CommentPayload extends Schema.Struct.Type<typeof CommentPayload.fields> {}
656
657/** `mutation T3CommentCreate` */
658export const T3CommentCreate = GraphQL.mutation("T3CommentCreate", {
659 document: {
660 variables: [
661 { name: "input", body: "CommentCreateInput!" }
662 ],
663 selections: [
664 { name: "commentCreate", body: ["(input:$", "input", "){success}"] }
665 ],
666 fragments: []
667 },
668 variables: {
669 input: Shared.CommentCreateInput
670 },
671 result: Schema.Struct({
672 /** Creates a new comment. */
673 commentCreate: CommentPayload
674 })
675})
676export declare namespace T3CommentCreate {
677 export type Variables = typeof T3CommentCreate.variables.Type
678 export type Result = typeof T3CommentCreate.result.Type
679}
680
681/** The result of a reaction mutation. */
682export const ReactionPayload = Schema.Struct({
683 /** Whether the operation was successful. */
684 success: Schema.Boolean
685})
686export interface ReactionPayload extends Schema.Struct.Type<typeof ReactionPayload.fields> {}
687
688/** `mutation T3ReactionCreate` */
689export const T3ReactionCreate = GraphQL.mutation("T3ReactionCreate", {
690 document: {
691 variables: [
692 { name: "input", body: "ReactionCreateInput!" }
693 ],
694 selections: [
695 { name: "reactionCreate", body: ["(input:$", "input", "){success}"] }
696 ],
697 fragments: []
698 },
699 variables: {
700 input: Shared.ReactionCreateInput
701 },
702 result: Schema.Struct({
703 /** Creates a new reaction. */
704 reactionCreate: ReactionPayload
705 })
706})
707export declare namespace T3ReactionCreate {
708 export type Variables = typeof T3ReactionCreate.variables.Type
709 export type Result = typeof T3ReactionCreate.result.Type
710}
711
712/** A generic payload return from entity deletion mutations. */
713export const DeletePayload = Schema.Struct({
714 /** Whether the operation was successful. */
715 success: Schema.Boolean
716})
717export interface DeletePayload extends Schema.Struct.Type<typeof DeletePayload.fields> {}
718
719/** `mutation T3ReactionDelete` */
720export const T3ReactionDelete = GraphQL.mutation("T3ReactionDelete", {
721 document: {
722 variables: [
723 { name: "id", body: "String!" }
724 ],
725 selections: [
726 { name: "reactionDelete", body: ["(id:$", "id", "){success}"] }
727 ],
728 fragments: []
729 },
730 variables: {
731 id: Schema.String
732 },
733 result: Schema.Struct({
734 /** Deletes a reaction. */
735 reactionDelete: DeletePayload
736 })
737})
738export declare namespace T3ReactionDelete {
739 export type Variables = typeof T3ReactionDelete.variables.Type
740 export type Result = typeof T3ReactionDelete.result.Type
741}
742
743/** An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes. */
744export const T3IssueReactionsIssueIssue = Schema.Struct({
745 /** Reactions associated with the issue. */
746 reactions: Schema.Array(LinearReaction)
747})
748export interface T3IssueReactionsIssueIssue extends Schema.Struct.Type<typeof T3IssueReactionsIssueIssue.fields> {}
749
750/** `query T3IssueReactions` */
751export const T3IssueReactions = GraphQL.query("T3IssueReactions", {
752 document: {
753 variables: [
754 { name: "id", body: "String!" }
755 ],
756 selections: [
757 { name: "issue", body: ["(id:$", "id", "){reactions{...LinearReaction}}"] }
758 ],
759 fragments: [
760 { name: "LinearReaction", body: ["on Reaction{id emoji user{...LinearUser}}"] },
761 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] }
762 ]
763 },
764 variables: {
765 id: Schema.String
766 },
767 result: Schema.Struct({
768 /** One specific issue, looked up by its unique identifier. */
769 issue: T3IssueReactionsIssueIssue
770 })
771})
772export declare namespace T3IssueReactions {
773 export type Variables = typeof T3IssueReactions.variables.Type
774 export type Result = typeof T3IssueReactions.result.Type
775}
776
777/** An issue is the core work item in Linear. Issues belong to a team, have a workflow status, can be assigned to users, carry a priority level, and can be organized into projects and cycles. Issues support sub-issues (parent-child hierarchy up to 10 levels deep), labels, due dates, estimates, and SLA tracking. They can also be linked to other issues via relations, attached to releases, and tracked through their full history of changes. */
778export const CommentIssueIssue = Schema.Struct({
779 /** The unique identifier of the entity. */
780 id: Shared.ID
781})
782export interface CommentIssueIssue extends Schema.Struct.Type<typeof CommentIssueIssue.fields> {}
783
784/** A comment associated with an issue, project update, initiative update, document content, post, project, or initiative. Comments support rich text (ProseMirror), emoji reactions, and threaded replies via parentId. Comments can be created by workspace users or by external users through integrations (e.g., Slack, Intercom). Each comment belongs to exactly one parent entity. */
785export const Comment = Schema.Struct({
786 /** The issue that the comment is associated with. Null if the comment belongs to a different parent entity type. */
787 issue: Schema.NullOr(CommentIssueIssue),
788 /** Reactions associated with the comment. */
789 reactions: Schema.Array(LinearReaction)
790})
791export interface Comment extends Schema.Struct.Type<typeof Comment.fields> {}
792
793/** `query T3CommentReactions` */
794export const T3CommentReactions = GraphQL.query("T3CommentReactions", {
795 document: {
796 variables: [
797 { name: "id", body: "String!" }
798 ],
799 selections: [
800 { name: "comment", body: ["(id:$", "id", "){issue{id}reactions{...LinearReaction}}"] }
801 ],
802 fragments: [
803 { name: "LinearReaction", body: ["on Reaction{id emoji user{...LinearUser}}"] },
804 { name: "LinearUser", body: ["on User{id name displayName email avatarUrl}"] }
805 ]
806 },
807 variables: {
808 id: Schema.String
809 },
810 result: Schema.Struct({
811 /** A specific comment. */
812 comment: Comment
813 })
814})
815export declare namespace T3CommentReactions {
816 export type Variables = typeof T3CommentReactions.variables.Type
817 export type Result = typeof T3CommentReactions.result.Type
818}
819
820/** Every operation in LinearApi.graphql. */
821export const LinearApiGraphQLGroup = GraphQLGroup.make(T3Viewer, T3Issues, T3Issue, T3Comments, T3Team, T3IssueCreate, T3IssueUpdate, T3CommentCreate, T3ReactionCreate, T3ReactionDelete, T3IssueReactions, T3CommentReactions)