1use crate::filters::*;
2use crate::types::*;
3use linear_schema::linear as schema;
4
5#[derive(cynic::QueryVariables, Debug, Clone)]
6pub struct IssuesArguments {
7 pub first: Option<i32>,
8 pub after: Option<String>,
9 pub filter: Option<IssueFilter>,
10}
11
12#[derive(cynic::QueryFragment, Debug)]
13#[cynic(
14 graphql_type = "Query",
15 schema = "linear",
16 variables = "IssuesArguments"
17)]
18pub struct IssuesQuery {
19 #[arguments(first: $first, after: $after, filter: $filter)]
20 pub issues: IssueConnection,
21}
22
23#[derive(cynic::QueryVariables, Debug, Clone)]
24pub struct IssueByIdArguments {
25 pub id: String,
26}
27
28#[derive(cynic::QueryFragment, Debug)]
29#[cynic(
30 graphql_type = "Query",
31 schema = "linear",
32 variables = "IssueByIdArguments"
33)]
34pub struct IssueByIdQuery {
35 #[arguments(id: $id)]
36 pub issue: Option<Issue>,
37}
38
39#[derive(cynic::QueryVariables, Debug, Clone)]
40pub struct SearchIssuesArguments {
41 pub term: String,
42 #[cynic(rename = "includeComments")]
43 pub include_comments: Option<bool>,
44 pub first: Option<i32>,
45 pub after: Option<String>,
46 pub filter: Option<IssueFilter>,
47}
48
49#[derive(cynic::QueryFragment, Debug)]
50#[cynic(
51 graphql_type = "Query",
52 schema = "linear",
53 variables = "SearchIssuesArguments"
54)]
55pub struct SearchIssuesQuery {
56 #[arguments(term: $term, includeComments: $include_comments, first: $first, after: $after, filter: $filter)]
57 #[cynic(rename = "searchIssues")]
58 pub search_issues: IssueSearchPayload,
59}
60
61#[derive(cynic::QueryVariables, Debug, Clone)]
66pub struct UsersArguments {
67 pub first: Option<i32>,
68 pub after: Option<String>,
69 pub filter: Option<UserFilter>,
70}
71
72#[derive(cynic::QueryFragment, Debug)]
73#[cynic(
74 graphql_type = "Query",
75 schema = "linear",
76 variables = "UsersArguments"
77)]
78pub struct UsersQuery {
79 #[arguments(first: $first, after: $after, filter: $filter)]
80 pub users: UserConnection,
81}
82
83#[derive(cynic::QueryVariables, Debug, Clone)]
84pub struct TeamsArguments {
85 pub first: Option<i32>,
86 pub after: Option<String>,
87 pub filter: Option<TeamFilter>,
88}
89
90#[derive(cynic::QueryFragment, Debug)]
91#[cynic(
92 graphql_type = "Query",
93 schema = "linear",
94 variables = "TeamsArguments"
95)]
96pub struct TeamsQuery {
97 #[arguments(first: $first, after: $after, filter: $filter)]
98 pub teams: TeamConnection,
99}
100
101#[derive(cynic::QueryVariables, Debug, Clone)]
102pub struct ProjectsArguments {
103 pub first: Option<i32>,
104 pub after: Option<String>,
105 pub filter: Option<ProjectFilter>,
106}
107
108#[derive(cynic::QueryFragment, Debug)]
109#[cynic(
110 graphql_type = "Query",
111 schema = "linear",
112 variables = "ProjectsArguments"
113)]
114pub struct ProjectsQuery {
115 #[arguments(first: $first, after: $after, filter: $filter)]
116 pub projects: ProjectConnection,
117}
118
119#[derive(cynic::QueryVariables, Debug, Clone)]
120pub struct WorkflowStatesArguments {
121 pub first: Option<i32>,
122 pub after: Option<String>,
123 pub filter: Option<WorkflowStateFilter>,
124}
125
126#[derive(cynic::QueryFragment, Debug)]
127#[cynic(
128 graphql_type = "Query",
129 schema = "linear",
130 variables = "WorkflowStatesArguments"
131)]
132pub struct WorkflowStatesQuery {
133 #[arguments(first: $first, after: $after, filter: $filter)]
134 #[cynic(rename = "workflowStates")]
135 pub workflow_states: WorkflowStateConnection,
136}
137
138#[derive(cynic::QueryVariables, Debug, Clone)]
139pub struct IssueLabelsArguments {
140 pub first: Option<i32>,
141 pub after: Option<String>,
142 pub filter: Option<IssueLabelFilter>,
143}
144
145#[derive(cynic::QueryFragment, Debug)]
146#[cynic(
147 graphql_type = "Query",
148 schema = "linear",
149 variables = "IssueLabelsArguments"
150)]
151pub struct IssueLabelsQuery {
152 #[arguments(first: $first, after: $after, filter: $filter)]
153 #[cynic(rename = "issueLabels")]
154 pub issue_labels: IssueLabelConnection,
155}
156
157#[derive(cynic::QueryFragment, Debug, Clone)]
162#[cynic(schema = "linear")]
163pub struct IssueRelation {
164 pub id: cynic::Id,
165 #[cynic(rename = "relatedIssue")]
166 pub related_issue: RelatedIssue,
167}
168
169#[derive(cynic::QueryFragment, Debug, Clone)]
170#[cynic(schema = "linear", graphql_type = "Issue")]
171pub struct RelatedIssue {
172 pub id: cynic::Id,
173}
174
175#[derive(cynic::QueryFragment, Debug, Clone)]
176#[cynic(schema = "linear")]
177pub struct IssueRelationConnection {
178 pub nodes: Vec<IssueRelation>,
179}
180
181#[derive(cynic::QueryFragment, Debug, Clone)]
182#[cynic(schema = "linear", graphql_type = "Issue")]
183pub struct IssueWithRelations {
184 pub id: cynic::Id,
185 pub relations: IssueRelationConnection,
186 #[cynic(rename = "inverseRelations")]
187 pub inverse_relations: IssueRelationConnection,
188}
189
190#[derive(cynic::QueryVariables, Debug, Clone)]
191pub struct IssueRelationsArguments {
192 pub id: String,
193}
194
195#[derive(cynic::QueryFragment, Debug)]
196#[cynic(
197 graphql_type = "Query",
198 schema = "linear",
199 variables = "IssueRelationsArguments"
200)]
201pub struct IssueRelationsQuery {
202 #[arguments(id: $id)]
203 pub issue: Option<IssueWithRelations>,
204}
205
206#[derive(cynic::QueryFragment, Debug, Clone)]
211#[cynic(
212 schema = "linear",
213 graphql_type = "Issue",
214 variables = "IssueCommentsArguments"
215)]
216pub struct IssueWithComments {
217 pub id: cynic::Id,
218 pub identifier: String,
219 #[arguments(first: $first, after: $after)]
220 pub comments: IssueCommentConnection,
221}
222
223#[derive(cynic::QueryVariables, Debug, Clone)]
224pub struct IssueCommentsArguments {
225 pub id: String,
226 pub first: Option<i32>,
227 pub after: Option<String>,
228}
229
230#[derive(cynic::QueryFragment, Debug)]
231#[cynic(
232 graphql_type = "Query",
233 schema = "linear",
234 variables = "IssueCommentsArguments"
235)]
236pub struct IssueCommentsQuery {
237 #[arguments(id: $id)]
238 pub issue: Option<IssueWithComments>,
239}