stacker.news/api/typeDefs/item.js

125 lines
3.4 KiB
JavaScript
Raw Normal View History

import { gql } from 'graphql-tag'
2021-04-12 18:05:09 +00:00
export default gql`
extend type Query {
items(sub: String, sort: String, type: String, cursor: String, name: String, when: String, by: String, limit: Int): Items
2021-04-14 23:56:29 +00:00
item(id: ID!): Item
2023-01-12 18:05:47 +00:00
pageTitleAndUnshorted(url: String!): TitleUnshorted
2021-10-28 20:49:51 +00:00
dupes(url: String!): [Item!]
2023-01-12 20:30:17 +00:00
related(cursor: String, title: String, id: ID, minMatch: String, limit: Int): Items
search(q: String, sub: String, cursor: String, what: String, sort: String, when: String, from: String, to: String): Items
2022-02-17 17:23:43 +00:00
auctionPosition(sub: String, id: ID, bid: Int!): Int!
2022-08-10 15:06:31 +00:00
itemRepetition(parentId: ID): Int!
2021-04-12 18:05:09 +00:00
}
2023-01-12 18:05:47 +00:00
type TitleUnshorted {
title: String
unshorted: String
}
2021-09-10 21:13:52 +00:00
type ItemActResult {
vote: Int!
2021-09-10 21:13:52 +00:00
sats: Int!
}
2021-04-12 18:05:09 +00:00
extend type Mutation {
bookmarkItem(id: ID): Item
subscribeItem(id: ID): Item
2023-01-12 23:53:09 +00:00
deleteItem(id: ID): Item
upsertLink(id: ID, sub: String, title: String!, url: String!, boost: Int, forward: [ItemForwardInput], hash: String, hmac: String): Item!
upsertDiscussion(id: ID, sub: String, title: String!, text: String, boost: Int, forward: [ItemForwardInput], hash: String, hmac: String): Item!
upsertBounty(id: ID, sub: String, title: String!, text: String, bounty: Int, hash: String, hmac: String, boost: Int, forward: [ItemForwardInput]): Item!
2023-05-01 20:58:30 +00:00
upsertJob(id: ID, sub: String!, title: String!, company: String!, location: String, remote: Boolean,
text: String!, url: String!, maxBid: Int!, status: String, logo: Int, hash: String, hmac: String): Item!
upsertPoll(id: ID, sub: String, title: String!, text: String, options: [String!]!, boost: Int, forward: [ItemForwardInput], hash: String, hmac: String): Item!
upsertComment(id:ID, text: String!, parentId: ID, hash: String, hmac: String): Item!
2023-09-14 02:08:03 +00:00
dontLikeThis(id: ID!, sats: Int, hash: String, hmac: String): Boolean!
act(id: ID!, sats: Int, hash: String, hmac: String): ItemActResult!
pollVote(id: ID!, hash: String, hmac: String): ID!
2022-07-30 13:25:46 +00:00
}
type PollOption {
id: ID,
option: String!
count: Int!
meVoted: Boolean!
}
type Poll {
meVoted: Boolean!
count: Int!
options: [PollOption!]!
2021-04-12 18:05:09 +00:00
}
2021-06-22 17:47:49 +00:00
type Items {
cursor: String
items: [Item!]!
2022-01-07 16:32:31 +00:00
pins: [Item!]
2021-06-22 17:47:49 +00:00
}
2021-06-24 23:56:01 +00:00
type Comments {
cursor: String
comments: [Item!]!
}
2021-04-12 18:05:09 +00:00
type Item {
id: ID!
2023-07-27 00:18:42 +00:00
createdAt: Date!
updatedAt: Date!
deletedAt: Date
2021-04-14 00:57:32 +00:00
title: String
2022-02-03 22:01:42 +00:00
searchTitle: String
2021-04-14 00:57:32 +00:00
url: String
2022-02-03 22:01:42 +00:00
searchText: String
2021-04-14 00:57:32 +00:00
text: String
2021-04-14 23:56:29 +00:00
parentId: Int
2021-07-08 00:15:27 +00:00
parent: Item
root: Item
2021-04-12 18:05:09 +00:00
user: User!
2022-01-27 19:18:48 +00:00
userId: Int!
2023-09-18 18:57:44 +00:00
depth: Int
2021-11-27 18:01:02 +00:00
mine: Boolean!
boost: Int!
2023-01-26 16:11:55 +00:00
bounty: Int
2023-01-26 23:28:10 +00:00
bountyPaidTo: [Int]
sats: Int!
2022-09-01 21:06:11 +00:00
commentSats: Int!
2023-07-27 00:18:42 +00:00
lastCommentAt: Date
upvotes: Int!
2022-10-28 15:58:31 +00:00
wvotes: Float!
2021-12-05 17:37:55 +00:00
meSats: Int!
2022-09-21 19:57:36 +00:00
meDontLike: Boolean!
meBookmark: Boolean!
meSubscription: Boolean!
2023-08-28 14:40:29 +00:00
meForward: Boolean
2022-09-22 18:44:50 +00:00
outlawed: Boolean!
2022-09-27 21:19:15 +00:00
freebie: Boolean!
2022-08-18 18:15:24 +00:00
paidImgLink: Boolean
2021-04-14 23:56:29 +00:00
ncomments: Int!
2023-07-26 00:45:35 +00:00
comments(sort: String): [Item!]!
path: String
2022-01-07 16:32:31 +00:00
position: Int
prior: Int
2022-02-17 17:23:43 +00:00
maxBid: Int
2022-09-29 20:42:33 +00:00
isJob: Boolean!
2022-07-30 13:25:46 +00:00
pollCost: Int
poll: Poll
2022-03-07 21:50:13 +00:00
company: String
location: String
remote: Boolean
2022-02-17 17:23:43 +00:00
sub: Sub
2023-05-05 17:38:56 +00:00
subName: String
2022-02-26 16:41:30 +00:00
status: String
2022-07-21 22:55:05 +00:00
uploadId: Int
2023-01-22 20:17:50 +00:00
otsHash: String
parentOtsHash: String
multiple forwards on a post (#403) * multiple forwards on a post first phase of the multi-forward support * update the graphql mutation for discussion posts to accept and validate multiple forwards * update the discussion form to allow multiple forwards in the UI * start working on db schema changes * uncomment db schema, add migration to create the new model, and update create_item, update_item stored procedures * Propagate updates from discussion to poll, link, and bounty forms Update the create, update poll sql functions for multi forward support * Update gql, typedefs, and resolver to return forwarded users in items responses * UI changes to show multiple forward recipients, and conditional upvote logic changes * Update notification text to reflect multiple forwards upon vote action * Disallow duplicate stacker entries * reduce duplication in populating adv-post-form initial values * Update item_act sql function to implement multi-way forwarding * Update referral functions to scale referral bonuses for forwarded users * Update notification text to reflect non-100% forwarded sats cases * Update wallet history sql queries to accommodate multi-forward use cases * Block zaps for posts you are forwarded zaps at the API layer, in addition to in the UI * Delete fwdUserId column from Item table as part of migration * Fix how we calculate stacked sats after partial forwards in wallet history * Exclude entries from wallet history that are 0 stacked sats from posts with 100% forwarded to other users * Fix wallet history query for forwarded stacked sats to be scaled by the fwd pct * Reduce duplication in adv post form, and do some style tweaks for better layout * Use MAX_FORWARDS constants * Address various PR feedback * first enhancement pass * enhancement pass too --------- Co-authored-by: keyan <keyan.kousha+huumn@gmail.com> Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-23 22:44:17 +00:00
forwards: [ItemForward]
2023-10-01 23:03:52 +00:00
imgproxyUrls: JSONObject
multiple forwards on a post (#403) * multiple forwards on a post first phase of the multi-forward support * update the graphql mutation for discussion posts to accept and validate multiple forwards * update the discussion form to allow multiple forwards in the UI * start working on db schema changes * uncomment db schema, add migration to create the new model, and update create_item, update_item stored procedures * Propagate updates from discussion to poll, link, and bounty forms Update the create, update poll sql functions for multi forward support * Update gql, typedefs, and resolver to return forwarded users in items responses * UI changes to show multiple forward recipients, and conditional upvote logic changes * Update notification text to reflect multiple forwards upon vote action * Disallow duplicate stacker entries * reduce duplication in populating adv-post-form initial values * Update item_act sql function to implement multi-way forwarding * Update referral functions to scale referral bonuses for forwarded users * Update notification text to reflect non-100% forwarded sats cases * Update wallet history sql queries to accommodate multi-forward use cases * Block zaps for posts you are forwarded zaps at the API layer, in addition to in the UI * Delete fwdUserId column from Item table as part of migration * Fix how we calculate stacked sats after partial forwards in wallet history * Exclude entries from wallet history that are 0 stacked sats from posts with 100% forwarded to other users * Fix wallet history query for forwarded stacked sats to be scaled by the fwd pct * Reduce duplication in adv post form, and do some style tweaks for better layout * Use MAX_FORWARDS constants * Address various PR feedback * first enhancement pass * enhancement pass too --------- Co-authored-by: keyan <keyan.kousha+huumn@gmail.com> Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-23 22:44:17 +00:00
}
input ItemForwardInput {
nym: String!
pct: Int!
2021-04-12 18:05:09 +00:00
}
`