Skip to content

Commit cf2691e

Browse files
committed
feat(term): impl subscription
1 parent a161ea4 commit cf2691e

14 files changed

+580
-66
lines changed

syndterm/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ graphql_client = { workspace = true }
1414
http = "0.2" # reqwest use 0.2
1515
http-serde-ext = "0.1"
1616
open = "5.0.1"
17+
palette = "0.7.3"
1718
# Use latest api
1819
ratatui = { git = "https://github.com/ratatui-org/ratatui.git", branch = "main"}
1920
reqwest = { workspace = true }

syndterm/gql/mutation.gql

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mutation User($input: SubscribeFeedInput!) {
2+
subscribeFeed(input: $input)
3+
}

syndterm/gql/query.gql

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
query User {
22
subscription {
33
feeds {
4-
url
4+
nodes {
5+
url
6+
}
57
}
68
}
79
}

syndterm/gql/schema.json

+258-12
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
"name": "skip"
5454
}
5555
],
56-
"mutationType": null,
56+
"mutationType": {
57+
"name": "Mutation"
58+
},
5759
"queryType": {
5860
"name": "Query"
5961
},
@@ -96,6 +98,124 @@
9698
"name": "Feed",
9799
"possibleTypes": null
98100
},
101+
{
102+
"description": null,
103+
"enumValues": null,
104+
"fields": [
105+
{
106+
"args": [],
107+
"deprecationReason": null,
108+
"description": "Information to aid in pagination.",
109+
"isDeprecated": false,
110+
"name": "pageInfo",
111+
"type": {
112+
"kind": "NON_NULL",
113+
"name": null,
114+
"ofType": {
115+
"kind": "OBJECT",
116+
"name": "PageInfo",
117+
"ofType": null
118+
}
119+
}
120+
},
121+
{
122+
"args": [],
123+
"deprecationReason": null,
124+
"description": "A list of edges.",
125+
"isDeprecated": false,
126+
"name": "edges",
127+
"type": {
128+
"kind": "NON_NULL",
129+
"name": null,
130+
"ofType": {
131+
"kind": "LIST",
132+
"name": null,
133+
"ofType": {
134+
"kind": "NON_NULL",
135+
"name": null,
136+
"ofType": {
137+
"kind": "OBJECT",
138+
"name": "FeedEdge",
139+
"ofType": null
140+
}
141+
}
142+
}
143+
}
144+
},
145+
{
146+
"args": [],
147+
"deprecationReason": null,
148+
"description": "A list of nodes.",
149+
"isDeprecated": false,
150+
"name": "nodes",
151+
"type": {
152+
"kind": "NON_NULL",
153+
"name": null,
154+
"ofType": {
155+
"kind": "LIST",
156+
"name": null,
157+
"ofType": {
158+
"kind": "NON_NULL",
159+
"name": null,
160+
"ofType": {
161+
"kind": "OBJECT",
162+
"name": "Feed",
163+
"ofType": null
164+
}
165+
}
166+
}
167+
}
168+
}
169+
],
170+
"inputFields": null,
171+
"interfaces": [],
172+
"kind": "OBJECT",
173+
"name": "FeedConnection",
174+
"possibleTypes": null
175+
},
176+
{
177+
"description": "An edge in a connection.",
178+
"enumValues": null,
179+
"fields": [
180+
{
181+
"args": [],
182+
"deprecationReason": null,
183+
"description": "The item at the end of the edge",
184+
"isDeprecated": false,
185+
"name": "node",
186+
"type": {
187+
"kind": "NON_NULL",
188+
"name": null,
189+
"ofType": {
190+
"kind": "OBJECT",
191+
"name": "Feed",
192+
"ofType": null
193+
}
194+
}
195+
},
196+
{
197+
"args": [],
198+
"deprecationReason": null,
199+
"description": "A cursor for use in pagination",
200+
"isDeprecated": false,
201+
"name": "cursor",
202+
"type": {
203+
"kind": "NON_NULL",
204+
"name": null,
205+
"ofType": {
206+
"kind": "SCALAR",
207+
"name": "String",
208+
"ofType": null
209+
}
210+
}
211+
}
212+
],
213+
"inputFields": null,
214+
"interfaces": [],
215+
"kind": "OBJECT",
216+
"name": "FeedEdge",
217+
"possibleTypes": null
218+
},
99219
{
100220
"description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",
101221
"enumValues": null,
@@ -126,6 +246,115 @@
126246
"name": "Int",
127247
"possibleTypes": null
128248
},
249+
{
250+
"description": null,
251+
"enumValues": null,
252+
"fields": [
253+
{
254+
"args": [
255+
{
256+
"defaultValue": null,
257+
"description": null,
258+
"name": "input",
259+
"type": {
260+
"kind": "NON_NULL",
261+
"name": null,
262+
"ofType": {
263+
"kind": "INPUT_OBJECT",
264+
"name": "SubscribeFeedInput",
265+
"ofType": null
266+
}
267+
}
268+
}
269+
],
270+
"deprecationReason": null,
271+
"description": null,
272+
"isDeprecated": false,
273+
"name": "subscribeFeed",
274+
"type": {
275+
"kind": "NON_NULL",
276+
"name": null,
277+
"ofType": {
278+
"kind": "SCALAR",
279+
"name": "String",
280+
"ofType": null
281+
}
282+
}
283+
}
284+
],
285+
"inputFields": null,
286+
"interfaces": [],
287+
"kind": "OBJECT",
288+
"name": "Mutation",
289+
"possibleTypes": null
290+
},
291+
{
292+
"description": "Information about pagination in a connection",
293+
"enumValues": null,
294+
"fields": [
295+
{
296+
"args": [],
297+
"deprecationReason": null,
298+
"description": "When paginating backwards, are there more items?",
299+
"isDeprecated": false,
300+
"name": "hasPreviousPage",
301+
"type": {
302+
"kind": "NON_NULL",
303+
"name": null,
304+
"ofType": {
305+
"kind": "SCALAR",
306+
"name": "Boolean",
307+
"ofType": null
308+
}
309+
}
310+
},
311+
{
312+
"args": [],
313+
"deprecationReason": null,
314+
"description": "When paginating forwards, are there more items?",
315+
"isDeprecated": false,
316+
"name": "hasNextPage",
317+
"type": {
318+
"kind": "NON_NULL",
319+
"name": null,
320+
"ofType": {
321+
"kind": "SCALAR",
322+
"name": "Boolean",
323+
"ofType": null
324+
}
325+
}
326+
},
327+
{
328+
"args": [],
329+
"deprecationReason": null,
330+
"description": "When paginating backwards, the cursor to continue.",
331+
"isDeprecated": false,
332+
"name": "startCursor",
333+
"type": {
334+
"kind": "SCALAR",
335+
"name": "String",
336+
"ofType": null
337+
}
338+
},
339+
{
340+
"args": [],
341+
"deprecationReason": null,
342+
"description": "When paginating forwards, the cursor to continue.",
343+
"isDeprecated": false,
344+
"name": "endCursor",
345+
"type": {
346+
"kind": "SCALAR",
347+
"name": "String",
348+
"ofType": null
349+
}
350+
}
351+
],
352+
"inputFields": null,
353+
"interfaces": [],
354+
"kind": "OBJECT",
355+
"name": "PageInfo",
356+
"possibleTypes": null
357+
},
129358
{
130359
"description": null,
131360
"enumValues": null,
@@ -163,6 +392,31 @@
163392
"name": "String",
164393
"possibleTypes": null
165394
},
395+
{
396+
"description": null,
397+
"enumValues": null,
398+
"fields": null,
399+
"inputFields": [
400+
{
401+
"defaultValue": null,
402+
"description": null,
403+
"name": "url",
404+
"type": {
405+
"kind": "NON_NULL",
406+
"name": null,
407+
"ofType": {
408+
"kind": "SCALAR",
409+
"name": "String",
410+
"ofType": null
411+
}
412+
}
413+
}
414+
],
415+
"interfaces": null,
416+
"kind": "INPUT_OBJECT",
417+
"name": "SubscribeFeedInput",
418+
"possibleTypes": null
419+
},
166420
{
167421
"description": null,
168422
"enumValues": null,
@@ -177,17 +431,9 @@
177431
"kind": "NON_NULL",
178432
"name": null,
179433
"ofType": {
180-
"kind": "LIST",
181-
"name": null,
182-
"ofType": {
183-
"kind": "NON_NULL",
184-
"name": null,
185-
"ofType": {
186-
"kind": "OBJECT",
187-
"name": "Feed",
188-
"ofType": null
189-
}
190-
}
434+
"kind": "OBJECT",
435+
"name": "FeedConnection",
436+
"ofType": null
191437
}
192438
}
193439
}

0 commit comments

Comments
 (0)