134 lines
3.6 KiB
JavaScript
Raw Normal View History

import { gql } from 'graphql-tag'
2021-04-12 13:05:09 -05:00
export default gql`
extend type Query {
2023-11-22 10:30:43 -06:00
items(sub: String, sort: String, type: String, cursor: String, name: String, when: String, from: String, to: String, by: String, limit: Limit): Items
2021-04-14 18:56:29 -05:00
item(id: ID!): Item
2023-01-12 12:05:47 -06:00
pageTitleAndUnshorted(url: String!): TitleUnshorted
2021-10-28 15:49:51 -05:00
dupes(url: String!): [Item!]
2023-11-22 10:30:43 -06:00
related(cursor: String, title: String, id: ID, minMatch: String, limit: Limit): Items
search(q: String, sub: String, cursor: String, what: String, sort: String, when: String, from: String, to: String): Items
2022-02-17 11:23:43 -06:00
auctionPosition(sub: String, id: ID, bid: Int!): Int!
2022-08-10 10:06:31 -05:00
itemRepetition(parentId: ID): Int!
2021-04-12 13:05:09 -05:00
}
2023-01-12 12:05:47 -06:00
type TitleUnshorted {
title: String
unshorted: String
}
2021-09-10 16:13:52 -05:00
type ItemActResult {
2023-12-26 15:55:48 -06:00
id: ID!
2021-09-10 16:13:52 -05:00
sats: Int!
2023-12-26 15:55:48 -06:00
path: String!
2023-12-26 16:51:47 -06:00
act: String!
2021-09-10 16:13:52 -05:00
}
2021-04-12 13:05:09 -05:00
extend type Mutation {
bookmarkItem(id: ID): Item
pinItem(id: ID): Item
subscribeItem(id: ID): Item
2023-01-12 17:53:09 -06:00
deleteItem(id: ID): Item
upsertLink(id: ID, sub: String, title: String!, url: String!, text: 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 15:58:30 -05: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, pollExpiresAt: Date): Item!
updateNoteId(id: ID!, noteId: String!): Item!
upsertComment(id:ID, text: String!, parentId: ID, hash: String, hmac: String): Item!
2023-12-27 10:15:18 -06:00
act(id: ID!, sats: Int, act: String, idempotent: Boolean, hash: String, hmac: String): ItemActResult!
pollVote(id: ID!, hash: String, hmac: String): ID!
toggleOutlaw(id: ID!): Item!
2022-07-30 08:25:46 -05:00
}
type PollOption {
id: ID,
option: String!
count: Int!
meVoted: Boolean!
}
type Poll {
meVoted: Boolean!
count: Int!
options: [PollOption!]!
2021-04-12 13:05:09 -05:00
}
2021-06-22 12:47:49 -05:00
type Items {
cursor: String
items: [Item!]!
2022-01-07 10:32:31 -06:00
pins: [Item!]
2021-06-22 12:47:49 -05:00
}
2021-06-24 18:56:01 -05:00
type Comments {
cursor: String
comments: [Item!]!
}
2021-04-12 13:05:09 -05:00
type Item {
id: ID!
2023-07-26 19:18:42 -05:00
createdAt: Date!
updatedAt: Date!
deletedAt: Date
deleteScheduledAt: Date
2021-04-13 19:57:32 -05:00
title: String
2022-02-03 16:01:42 -06:00
searchTitle: String
2021-04-13 19:57:32 -05:00
url: String
2022-02-03 16:01:42 -06:00
searchText: String
2021-04-13 19:57:32 -05:00
text: String
2021-04-14 18:56:29 -05:00
parentId: Int
2021-07-07 19:15:27 -05:00
parent: Item
root: Item
2021-04-12 13:05:09 -05:00
user: User!
2022-01-27 13:18:48 -06:00
userId: Int!
2023-09-18 20:57:44 +02:00
depth: Int
2021-11-27 12:01:02 -06:00
mine: Boolean!
boost: Int!
2023-01-26 10:11:55 -06:00
bounty: Int
2023-01-26 17:28:10 -06:00
bountyPaidTo: [Int]
noteId: String
sats: Int!
2022-09-01 16:06:11 -05:00
commentSats: Int!
2023-07-26 19:18:42 -05:00
lastCommentAt: Date
upvotes: Int!
2021-12-05 11:37:55 -06:00
meSats: Int!
meDontLikeSats: Int!
meBookmark: Boolean!
meSubscription: Boolean!
2023-08-28 09:40:29 -05:00
meForward: Boolean
2022-09-22 13:44:50 -05:00
outlawed: Boolean!
2022-09-27 16:19:15 -05:00
freebie: Boolean!
2023-11-21 17:26:24 -06:00
freedFreebie: Boolean!
2023-11-19 14:16:35 -06:00
bio: Boolean!
2022-08-18 13:15:24 -05:00
paidImgLink: Boolean
2021-04-14 18:56:29 -05:00
ncomments: Int!
2023-07-25 19:45:35 -05:00
comments(sort: String): [Item!]!
path: String
2022-01-07 10:32:31 -06:00
position: Int
prior: Int
2022-02-17 11:23:43 -06:00
maxBid: Int
2022-09-29 15:42:33 -05:00
isJob: Boolean!
2022-07-30 08:25:46 -05:00
pollCost: Int
poll: Poll
pollExpiresAt: Date
2022-03-07 15:50:13 -06:00
company: String
location: String
remote: Boolean
2022-02-17 11:23:43 -06:00
sub: Sub
2023-05-05 12:38:56 -05:00
subName: String
2022-02-26 10:41:30 -06:00
status: String
2022-07-21 17:55:05 -05:00
uploadId: Int
2023-01-22 14:17:50 -06: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 18:44:17 -04:00
forwards: [ItemForward]
2023-10-02 01:03:52 +02:00
imgproxyUrls: JSONObject
2024-03-04 19:20:14 -06:00
rel: 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 18:44:17 -04:00
}
input ItemForwardInput {
nym: String!
pct: Int!
2021-04-12 13:05:09 -05:00
}
`