Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tag): retire unused tag queries and previous deprecated #4217

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 0 additions & 139 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,9 @@ type Mutation {

"""Follow or unfollow tag."""
toggleFollowTag(input: ToggleItemInput!): Tag!

"""Create or update tag."""
putTag(input: PutTagInput!): Tag!

"""Update member, permission and othters of a tag."""
updateTagSetting(input: UpdateTagSettingInput!): Tag!

"""Add one tag to articles."""
addArticlesTags(input: AddArticlesTagsInput!): Tag!

"""Update articles' tag."""
updateArticlesTags(input: UpdateArticlesTagsInput!): Tag!

"""Delete one tag from articles"""
deleteArticlesTags(input: DeleteArticlesTagsInput!): Tag!
toggleArticleRecommend(input: ToggleRecommendInput!): Article!
updateArticleState(input: UpdateArticleStateInput!): Article!
updateArticleSensitive(input: UpdateArticleSensitiveInput!): Article!
toggleTagRecommend(input: ToggleRecommendInput!): Tag!
deleteTags(input: DeleteTagsInput!): Boolean
renameTag(input: RenameTagInput!): Tag!
mergeTags(input: MergeTagsInput!): Tag!
Expand Down Expand Up @@ -168,9 +152,6 @@ type Mutation {
"""Reset user or payment password."""
resetPassword(input: ResetPasswordInput!): Boolean

"""Change user email."""
changeEmail(input: ChangeEmailInput!): User! @deprecated(reason: "use 'setEmail' instead")

"""Set user email."""
setEmail(input: SetEmailInput!): User!

Expand All @@ -180,11 +161,7 @@ type Mutation {
"""Set user currency preference."""
setCurrency(input: SetCurrencyInput!): User!

"""Register user, can only be used on matters.{town,news} website."""
userRegister(input: UserRegisterInput!): AuthResult! @deprecated(reason: "use 'emailLogin' instead")

"""Login user."""
userLogin(input: UserLoginInput!): AuthResult! @deprecated(reason: "use 'emailLogin' instead")
emailLogin(input: EmailLoginInput!): AuthResult!

"""Get signing message."""
Expand All @@ -208,15 +185,9 @@ type Mutation {
"""Remove a social login from current user."""
removeSocialLogin(input: RemoveSocialLoginInput!): User!

"""Reset crypto wallet."""
resetWallet(input: ResetWalletInput!): User! @deprecated(reason: "use 'removeWalletLogin' instead")

"""Logout user."""
userLogout: Boolean!

"""Generate or claim a Liker ID through LikeCoin"""
generateLikerId: User! @deprecated(reason: "No longer in use")

"""Reset Liker ID"""
resetLikerId(input: ResetLikerIdInput!): User!

Expand Down Expand Up @@ -412,7 +383,6 @@ type Article implements Node & PinnableWork {
"""
This value determines if this article is an author selected article or not.
"""
sticky: Boolean! @deprecated(reason: "Use pinned instead")
pinned: Boolean!

"""Translation of article title and content."""
Expand All @@ -430,15 +400,6 @@ type Article implements Node & PinnableWork {
"""Cumulative reading time in seconds"""
readTime: Float!

"""Drafts linked to this article."""
drafts: [Draft!] @deprecated(reason: "Use Article.newestUnpublishedDraft or Article.newestPublishedDraft instead")

"""Newest unpublished draft linked to this article."""
newestUnpublishedDraft: Draft

"""Newest published draft linked to this article."""
newestPublishedDraft: Draft!

"""Revision Count"""
revisionCount: Int!

Expand Down Expand Up @@ -549,42 +510,15 @@ type Tag implements Node {
"""List of how many articles were attached with this tag."""
articles(input: TagArticlesInput!): ArticleConnection!

"""This value determines if this article is selected by this tag or not."""
selected(input: TagSelectedInput!): Boolean!

"""Time of this tag was created."""
createdAt: DateTime!

"""Tag's cover link."""
cover: String

"""Description of this tag."""
description: String

"""Editors of this tag."""
editors(input: TagEditorsInput): [User!]

"""Creator of this tag."""
creator: User

"""Owner of this tag."""
owner: User

"""This value determines if current viewer is following or not."""
isFollower: Boolean

"""Followers of this tag."""
followers(input: ConnectionArgs!): UserConnection!

"""Participants of this tag."""
participants(input: ConnectionArgs!): UserConnection!

"""Tags recommended based on relations to current tag."""
recommended(input: ConnectionArgs!): TagConnection!

"""This value determines if it is official."""
isOfficial: Boolean

"""Counts of this tag."""
numArticles: Int!
numAuthors: Int!
Expand Down Expand Up @@ -637,7 +571,6 @@ type ArticleTranslation {
type TagOSS {
boost: Float!
score: Float!
selected: Boolean!
}

type ArticleConnection implements Connection {
Expand Down Expand Up @@ -693,9 +626,6 @@ input PublishArticleInput {
input EditArticleInput {
id: ID!
state: ArticleState

"""deprecated, use pinned instead"""
sticky: Boolean
pinned: Boolean
title: String
summary: String
Expand Down Expand Up @@ -770,36 +700,6 @@ input MergeTagsInput {
content: String!
}

input PutTagInput {
id: ID
content: String
cover: ID
description: String
}

input UpdateTagSettingInput {
id: ID!
type: UpdateTagSettingType!
editors: [ID!]
}

input AddArticlesTagsInput {
id: ID!
articles: [ID!]
selected: Boolean
}

input UpdateArticlesTagsInput {
id: ID!
articles: [ID!]
isSelected: Boolean!
}

input DeleteArticlesTagsInput {
id: ID!
articles: [ID!]
}

enum TagArticlesSortBy {
byHottestDesc
byCreatedAtDesc
Expand All @@ -813,16 +713,6 @@ input TagArticlesInput {
sortBy: TagArticlesSortBy = byCreatedAtDesc
}

input TagSelectedInput {
id: ID
mediaHash: String
}

input TagEditorsInput {
excludeAdmin: Boolean
excludeOwner: Boolean
}

input TransactionsReceivedByArgs {
after: String
first: Int
Expand Down Expand Up @@ -872,14 +762,6 @@ enum RecommendTypes {
search
}

enum UpdateTagSettingType {
adopt
leave
add_editor
remove_editor
leave_editor
}

input CampaignInput {
shortHash: String!
}
Expand Down Expand Up @@ -2578,9 +2460,6 @@ type Recommendation {
"""Activities based on user's following, sort by creation time."""
following(input: RecommendationFollowingInput!): FollowingActivityConnection!

"""Articles recommended based on recently read article tags."""
readTagsArticles(input: ConnectionArgs!): ArticleConnection! @deprecated(reason: "Merged into following")

"""Global articles sort by publish time."""
newest(input: ConnectionArgs!): ArticleConnection!

Expand Down Expand Up @@ -2798,9 +2677,6 @@ type Liker {

"""Total LIKE left in wallet."""
total: Float!

"""Rate of LikeCoin/USD"""
rateUSD: Float @deprecated(reason: "No longer in use")
}

type UserOSS {
Expand Down Expand Up @@ -3119,11 +2995,6 @@ input UserRegisterInput {
referralCode: String
}

input UserLoginInput {
email: String!
password: String!
}

input GenerateSigningMessageInput {
address: String!
purpose: SigningMessagePurpose
Expand All @@ -3141,12 +3012,6 @@ input WalletLoginInput {
"""nonce from generateSigningMessage"""
nonce: String!

"""required for wallet register"""
email: String @deprecated(reason: "No longer in use")

"""email verification code, required for wallet register"""
codeId: ID @deprecated(reason: "No longer in use")

"""used in register"""
language: UserLanguage
referralCode: String
Expand All @@ -3167,7 +3032,6 @@ input UpdateNotificationSettingInput {

input UpdateUserInfoInput {
displayName: String
userName: String @deprecated(reason: "use 'setUserName' instead")
avatar: ID
description: String
language: UserLanguage
Expand Down Expand Up @@ -3261,9 +3125,6 @@ enum VerificationCodeType {
register
email_verify
email_otp
email_reset @deprecated(reason: "No longer in use")
email_reset_confirm @deprecated(reason: "No longer in use")
password_reset @deprecated(reason: "No longer in use")
payment_password_reset
}

Expand Down
15 changes: 1 addition & 14 deletions src/connectors/__test__/tagService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,10 @@ describe('findArticleIds', () => {
})
})

test('findArticleCovers', async () => {
const covers = await tagService.findArticleCovers({ id: '2' })
expect(covers).toBeDefined()

const cached = await tagService.findArticleCovers({ id: '2' })
expect(cached).toEqual(covers)
})

test('create', async () => {
const content = 'foo'
const tag = await tagService.create(
{
content,
creator: '0',
editors: [],
owner: '0',
},
{ content, creator: '0' },
{
columns: ['id', 'content'],
}
Expand Down
Loading
Loading