2023-07-23 15:08:43 +00:00
|
|
|
import { gql } from 'graphql-tag'
|
2022-02-17 17:23:43 +00:00
|
|
|
|
|
|
|
export default gql`
|
|
|
|
extend type Query {
|
2023-07-23 15:08:43 +00:00
|
|
|
sub(name: String): Sub
|
2023-05-01 20:58:30 +00:00
|
|
|
subLatestPost(name: String!): String
|
2023-11-21 23:32:22 +00:00
|
|
|
subs: [Sub!]!
|
2024-02-14 20:27:00 +00:00
|
|
|
topSubs(cursor: String, when: String, from: String, to: String, by: String, limit: Limit): Subs
|
2024-02-22 01:55:48 +00:00
|
|
|
userSubs(name: String!, cursor: String, when: String, from: String, to: String, by: String, limit: Limit): Subs
|
2024-02-14 20:27:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Subs {
|
|
|
|
cursor: String
|
|
|
|
subs: [Sub!]!
|
2023-11-21 23:32:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
2024-01-11 23:45:17 +00:00
|
|
|
upsertSub(oldName: String, name: String!, desc: String, baseCost: Int!,
|
2023-12-10 21:41:20 +00:00
|
|
|
postTypes: [String!]!, allowFreebies: Boolean!,
|
|
|
|
billingType: String!, billingAutoRenew: Boolean!,
|
2024-07-04 17:30:42 +00:00
|
|
|
moderated: Boolean!, nsfw: Boolean!): SubPaidAction!
|
|
|
|
paySub(name: String!): SubPaidAction!
|
2023-12-15 18:10:29 +00:00
|
|
|
toggleMuteSub(name: String!): Boolean!
|
2024-02-23 15:12:49 +00:00
|
|
|
toggleSubSubscription(name: String!): Boolean!
|
2024-03-05 19:56:02 +00:00
|
|
|
transferTerritory(subName: String!, userName: String!): Sub
|
2024-03-19 22:23:59 +00:00
|
|
|
unarchiveTerritory(name: String!, desc: String, baseCost: Int!,
|
|
|
|
postTypes: [String!]!, allowFreebies: Boolean!,
|
|
|
|
billingType: String!, billingAutoRenew: Boolean!,
|
2024-07-04 17:30:42 +00:00
|
|
|
moderated: Boolean!, nsfw: Boolean!): SubPaidAction!
|
2022-02-17 17:23:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Sub {
|
2023-11-21 23:32:22 +00:00
|
|
|
name: ID!
|
2023-07-27 00:18:42 +00:00
|
|
|
createdAt: Date!
|
2023-11-21 23:32:22 +00:00
|
|
|
userId: Int!
|
|
|
|
user: User!
|
|
|
|
desc: String
|
2023-07-27 00:18:42 +00:00
|
|
|
updatedAt: Date!
|
2022-02-17 17:23:43 +00:00
|
|
|
postTypes: [String!]!
|
2023-12-10 21:41:20 +00:00
|
|
|
allowFreebies: Boolean!
|
2023-11-21 23:32:22 +00:00
|
|
|
billingCost: Int!
|
|
|
|
billingType: String!
|
2023-12-08 20:02:00 +00:00
|
|
|
billingAutoRenew: Boolean!
|
2022-02-17 17:23:43 +00:00
|
|
|
rankingType: String!
|
2023-11-21 23:32:22 +00:00
|
|
|
billedLastAt: Date!
|
2024-02-16 18:25:12 +00:00
|
|
|
billPaidUntil: Date
|
2022-02-17 17:23:43 +00:00
|
|
|
baseCost: Int!
|
2023-11-21 23:32:22 +00:00
|
|
|
status: String!
|
2023-12-23 20:26:16 +00:00
|
|
|
moderated: Boolean!
|
|
|
|
moderatedCount: Int!
|
2023-12-15 18:10:29 +00:00
|
|
|
meMuteSub: Boolean!
|
2024-02-10 02:35:32 +00:00
|
|
|
nsfw: Boolean!
|
2024-02-14 20:27:00 +00:00
|
|
|
nposts(when: String, from: String, to: String): Int!
|
|
|
|
ncomments(when: String, from: String, to: String): Int!
|
2024-02-23 15:12:49 +00:00
|
|
|
meSubscription: Boolean!
|
2024-02-14 20:27:00 +00:00
|
|
|
|
|
|
|
optional: SubOptional!
|
|
|
|
}
|
|
|
|
|
|
|
|
type SubOptional {
|
|
|
|
"""
|
|
|
|
conditionally private
|
|
|
|
"""
|
|
|
|
stacked(when: String, from: String, to: String): Int
|
|
|
|
spent(when: String, from: String, to: String): Int
|
|
|
|
revenue(when: String, from: String, to: String): Int
|
2022-02-17 17:23:43 +00:00
|
|
|
}
|
|
|
|
`
|