Skip to content

Commit

Permalink
feat(term): support feed annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Apr 10, 2024
1 parent 9c9c89a commit 937b561
Show file tree
Hide file tree
Showing 18 changed files with 334 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .helix/languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ diagnostics.disabled = ["inactive-code"]
hover.actions.enable = false

[language-server.rust-analyzer.config.cargo]
features = ["introspection", "integration", "opentelemetry-stdout"]
features = ["introspection", "integration", "opentelemetry-stdout", "graphql"]

[language-server.rust-analyzer.config.check]
command = "clippy"
Expand Down
55 changes: 2 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repository = "https://github.com/ymgyt/syndicationd"

[workspace.dependencies]
anyhow = { version = "1", default-features = false, features = ["std"] }
async-graphql = { version = "7.0" }
async-trait = { version = "0.1.79", default-features = false }
axum = { version = "0.7.5", default-features = false }
axum-server = { version = "0.6.0", features = ["tls-rustls"] }
Expand All @@ -29,7 +30,6 @@ http = { version = "0.2" }
itertools = { version = "0.12", default-features = false, features = ["use_std"] }
kvsd = { version = "0.1.3", default-features = false }
moka = { version = "0.12.4", features = ["future"] }
nutype = { version = "0.4.0", default-features = false }
parse_duration = { version = "2.1.1" }
rand = { version = "0.8.5" }
reqwest = { version = "0.11.24", default-features = false, features = ["rustls-tls", "json"] }
Expand Down
1 change: 0 additions & 1 deletion crates/synd_term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ graphql_client = { workspace = true }
html2text = { version = "0.12" }
itertools = { workspace = true }
nom = { version = "7.1.3", default-features = false, features = ["std"] }
nutype = { workspace = true }
open = "5.1.0"
parse_duration = { workspace = true }
ratatui = { version = "0.26.0" }
Expand Down
10 changes: 6 additions & 4 deletions crates/synd_term/gql/mutation.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mutation SubscribeFeed($input: SubscribeFeedInput!) {
subscribeFeed(input: $input) {
mutation SubscribeFeed($subscribeInput: SubscribeFeedInput!) {
subscribeFeed(input: $subscribeInput) {
__typename
... on SubscribeFeedSuccess {
feed {
Expand All @@ -18,8 +18,8 @@ mutation SubscribeFeed($input: SubscribeFeedInput!) {
}
}

mutation UnsubscribeFeed($input: UnsubscribeFeedInput!) {
unsubscribeFeed(input: $input) {
mutation UnsubscribeFeed($unsubscribeInput: UnsubscribeFeedInput!) {
unsubscribeFeed(input: $unsubscribeInput) {
__typename
... on UnsubscribeFeedSuccess {
status {
Expand All @@ -43,6 +43,8 @@ fragment Feed on Feed {
websiteUrl
description
generator
requirement
category
entries(first: 20) {
nodes {
...EntryMeta
Expand Down
2 changes: 2 additions & 0 deletions crates/synd_term/gql/query.gql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fragment Feed on Feed {
websiteUrl
description
generator
requirement
category
entries(first: 20) {
nodes {
...EntryMeta
Expand Down
101 changes: 100 additions & 1 deletion crates/synd_term/gql/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
"name": "Boolean",
"possibleTypes": null
},
{
"description": null,
"enumValues": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"kind": "SCALAR",
"name": "Category",
"possibleTypes": null
},
{
"description": null,
"enumValues": null,
Expand Down Expand Up @@ -130,7 +140,7 @@
{
"args": [],
"deprecationReason": null,
"description": "Entry summary",
"description": "Entry summary. If there is no summary of the entry, return the content(is this bad api?)",
"isDeprecated": false,
"name": "summary",
"type": {
Expand Down Expand Up @@ -446,6 +456,30 @@
"name": "String",
"ofType": null
}
},
{
"args": [],
"deprecationReason": null,
"description": "Requirement level for feed",
"isDeprecated": false,
"name": "requirement",
"type": {
"kind": "ENUM",
"name": "Requirement",
"ofType": null
}
},
{
"args": [],
"deprecationReason": null,
"description": "Feed category",
"isDeprecated": false,
"name": "category",
"type": {
"kind": "SCALAR",
"name": "Category",
"ofType": null
}
}
],
"inputFields": null,
Expand Down Expand Up @@ -1160,6 +1194,35 @@
"name": "Query",
"possibleTypes": null
},
{
"description": "`Requirement` expresses how important the feed is\nusing an analogy to [RFC2119](https://datatracker.ietf.org/doc/html/rfc2119)",
"enumValues": [
{
"deprecationReason": null,
"description": "`Must` indicates it must be read",
"isDeprecated": false,
"name": "MUST"
},
{
"deprecationReason": null,
"description": "`Should` suggests it should be read unless there is a special reason not to",
"isDeprecated": false,
"name": "SHOULD"
},
{
"deprecationReason": null,
"description": "`May` implies it is probably worth reading",
"isDeprecated": false,
"name": "MAY"
}
],
"fields": null,
"inputFields": null,
"interfaces": null,
"kind": "ENUM",
"name": "Requirement",
"possibleTypes": null
},
{
"description": null,
"enumValues": [
Expand Down Expand Up @@ -1421,6 +1484,26 @@
"ofType": null
}
}
},
{
"defaultValue": null,
"description": "Requirement level for feed",
"name": "requirement",
"type": {
"kind": "ENUM",
"name": "Requirement",
"ofType": null
}
},
{
"defaultValue": null,
"description": "Feed category",
"name": "category",
"type": {
"kind": "SCALAR",
"name": "Category",
"ofType": null
}
}
],
"interfaces": null,
Expand Down Expand Up @@ -2166,6 +2249,22 @@
"description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes\nall available types and directives on the server, as well as the entry\npoints for query, mutation, and subscription operations.",
"enumValues": null,
"fields": [
{
"args": [],
"deprecationReason": null,
"description": "description of __Schema for newer graphiql introspection schema\nrequirements",
"isDeprecated": false,
"name": "description",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
{
"args": [],
"deprecationReason": null,
Expand Down

0 comments on commit 937b561

Please sign in to comment.