add feeds graphql api to the schema

This commit is contained in:
Hongbo Wu
2023-10-27 17:54:40 +08:00
parent 83054cfeba
commit e282eea99f
3 changed files with 170 additions and 0 deletions

View File

@ -641,6 +641,18 @@ type Feature {
updatedAt: Date
}
type Feed {
author: String
createdAt: Date!
description: String
id: ID!
image: String
publishedAt: Date
title: String!
updatedAt: Date!
url: String!
}
type FeedArticle {
annotationsCount: Int
article: Article!
@ -674,6 +686,27 @@ type FeedArticlesSuccess {
pageInfo: PageInfo!
}
type FeedEdge {
cursor: String!
node: Feed!
}
type FeedsError {
errorCodes: [FeedsErrorCode!]!
}
enum FeedsErrorCode {
BAD_REQUEST
UNAUTHORIZED
}
union FeedsResult = FeedsError | FeedsSuccess
type FeedsSuccess {
edges: [FeedEdge!]!
pageInfo: PageInfo!
}
type Filter {
category: String!
createdAt: Date!
@ -1294,6 +1327,7 @@ type Query {
article(format: String, slug: String!, username: String!): ArticleResult!
articleSavingRequest(id: ID, url: String): ArticleSavingRequestResult!
deviceTokens: DeviceTokensResult!
feeds(after: String, first: Int, query: String!, sort: SortParams): FeedsResult!
filters: FiltersResult!
getUserPersonalization: GetUserPersonalizationResult!
groups: GroupsResult!