diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-09 21:41:09 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-07-09 21:41:09 +0900 |
| commit | ce42724c7b055f8f4d1080410e1cf358cbe99189 (patch) | |
| tree | fdd9ef79686d9f4eb6539b395462207cf285900f /common | |
| parent | 60a3e917e3457f35729abd1e452c5b4231885833 (diff) | |
| download | feedaka-ce42724c7b055f8f4d1080410e1cf358cbe99189.tar.gz feedaka-ce42724c7b055f8f4d1080410e1cf358cbe99189.tar.zst feedaka-ce42724c7b055f8f4d1080410e1cf358cbe99189.zip | |
feat(common): add GraphQL schema
Diffstat (limited to 'common')
| -rw-r--r-- | common/graphql/schema.graphql | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/common/graphql/schema.graphql b/common/graphql/schema.graphql new file mode 100644 index 0000000..2ee1365 --- /dev/null +++ b/common/graphql/schema.graphql @@ -0,0 +1,136 @@ +scalar DateTime + +""" +Represents a feed subscription in the system +""" +type Feed { + """ + Unique identifier for the feed + """ + id: ID! + + """ + URL of the RSS/Atom feed + """ + url: String! + + """ + Title of the feed (extracted from feed metadata) + """ + title: String! + + """ + Timestamp when the feed was last fetched + """ + fetchedAt: DateTime! + + """ + Articles belonging to this feed + """ + articles: [Article!]! +} + +""" +Represents an individual article/post from a feed +""" +type Article { + """ + Unique identifier for the article + """ + id: ID! + + """ + ID of the feed this article belongs to + """ + feedId: ID! + + """ + GUID from the RSS/Atom feed (unique identifier from feed) + """ + guid: String! + + """ + Title of the article + """ + title: String! + + """ + URL/link to the original article + """ + url: String! + + """ + Whether the article has been marked as read + """ + isRead: Boolean! + + """ + The feed this article belongs to + """ + feed: Feed! +} + +""" +Root query type for reading data +""" +type Query { + """ + Get all feeds with their metadata + """ + feeds: [Feed!]! + + """ + Get all unread articles across all feeds + """ + unreadArticles: [Article!]! + + """ + Get all read articles across all feeds + """ + readArticles: [Article!]! + + """ + Get a specific feed by ID + """ + feed(id: ID!): Feed + + """ + Get a specific article by ID + """ + article(id: ID!): Article +} + +""" +Root mutation type for modifying data +""" +type Mutation { + """ + Add a new feed subscription + """ + addFeed(url: String!): Feed! + + """ + Remove a feed subscription and all its articles + """ + removeFeed(id: ID!): Boolean! + + """ + Mark an article as read + """ + markArticleRead(id: ID!): Article! + + """ + Mark an article as unread + """ + markArticleUnread(id: ID!): Article! + + """ + Mark all articles in a feed as read + """ + markFeedRead(id: ID!): Feed! + + """ + Mark all articles in a feed as unread + """ + markFeedUnread(id: ID!): Feed! +} |
