2021-09-24 21:28:21 +00:00
|
|
|
import { gql } from '@apollo/client'
|
2021-10-26 20:49:37 +00:00
|
|
|
import { COMMENT_FIELDS } from './comments'
|
2021-09-30 15:46:58 +00:00
|
|
|
import { ITEM_FIELDS, ITEM_WITH_COMMENTS } from './items'
|
2021-09-24 21:28:21 +00:00
|
|
|
|
2021-11-28 17:29:17 +00:00
|
|
|
export const ME = gql`
|
|
|
|
{
|
|
|
|
me {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
sats
|
|
|
|
stacked
|
|
|
|
freePosts
|
|
|
|
freeComments
|
|
|
|
hasNewNotes
|
|
|
|
tipDefault
|
2022-04-28 18:11:05 +00:00
|
|
|
bioId
|
2021-11-28 17:29:17 +00:00
|
|
|
hasInvites
|
2021-12-09 20:40:40 +00:00
|
|
|
upvotePopover
|
|
|
|
tipPopover
|
2022-04-21 22:50:02 +00:00
|
|
|
noteItemSats
|
|
|
|
noteEarning
|
|
|
|
noteAllDescendants
|
|
|
|
noteMentions
|
|
|
|
noteDeposits
|
|
|
|
noteInvites
|
2022-05-09 17:30:27 +00:00
|
|
|
noteJobIndicator
|
2022-08-30 21:50:47 +00:00
|
|
|
hideInvoiceDesc
|
2022-05-09 17:30:27 +00:00
|
|
|
lastCheckedJobs
|
2021-11-28 17:29:17 +00:00
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
2022-04-28 22:00:09 +00:00
|
|
|
export const ME_SSR = gql`
|
|
|
|
{
|
|
|
|
me {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
sats
|
|
|
|
stacked
|
|
|
|
freePosts
|
|
|
|
freeComments
|
|
|
|
tipDefault
|
|
|
|
bioId
|
|
|
|
upvotePopover
|
|
|
|
tipPopover
|
|
|
|
noteItemSats
|
|
|
|
noteEarning
|
|
|
|
noteAllDescendants
|
|
|
|
noteMentions
|
|
|
|
noteDeposits
|
|
|
|
noteInvites
|
2022-05-09 17:30:27 +00:00
|
|
|
noteJobIndicator
|
2022-08-30 21:50:47 +00:00
|
|
|
hideInvoiceDesc
|
2022-05-09 17:30:27 +00:00
|
|
|
lastCheckedJobs
|
2022-04-28 22:00:09 +00:00
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
2022-09-06 13:01:49 +00:00
|
|
|
export const SETTINGS_FIELDS = gql`
|
|
|
|
fragment SettingsFields on User {
|
2022-06-02 22:55:23 +00:00
|
|
|
tipDefault
|
|
|
|
noteItemSats
|
|
|
|
noteEarning
|
|
|
|
noteAllDescendants
|
|
|
|
noteMentions
|
|
|
|
noteDeposits
|
|
|
|
noteInvites
|
|
|
|
noteJobIndicator
|
2022-08-30 21:50:47 +00:00
|
|
|
hideInvoiceDesc
|
2022-06-02 22:55:23 +00:00
|
|
|
authMethods {
|
|
|
|
lightning
|
|
|
|
email
|
|
|
|
twitter
|
|
|
|
github
|
|
|
|
}
|
2022-09-06 13:01:49 +00:00
|
|
|
}`
|
|
|
|
|
|
|
|
export const SETTINGS = gql`
|
|
|
|
${SETTINGS_FIELDS}
|
|
|
|
{
|
|
|
|
settings {
|
|
|
|
...SettingsFields
|
2022-06-02 22:55:23 +00:00
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
2022-09-06 13:01:49 +00:00
|
|
|
export const SET_SETTINGS =
|
|
|
|
gql`
|
|
|
|
${SETTINGS_FIELDS}
|
|
|
|
mutation setSettings($tipDefault: Int!, $noteItemSats: Boolean!, $noteEarning: Boolean!,
|
|
|
|
$noteAllDescendants: Boolean!, $noteMentions: Boolean!, $noteDeposits: Boolean!,
|
|
|
|
$noteInvites: Boolean!, $noteJobIndicator: Boolean!, $hideInvoiceDesc: Boolean!) {
|
|
|
|
setSettings(tipDefault: $tipDefault, noteItemSats: $noteItemSats,
|
|
|
|
noteEarning: $noteEarning, noteAllDescendants: $noteAllDescendants,
|
|
|
|
noteMentions: $noteMentions, noteDeposits: $noteDeposits, noteInvites: $noteInvites,
|
|
|
|
noteJobIndicator: $noteJobIndicator, hideInvoiceDesc: $hideInvoiceDesc) {
|
|
|
|
...SettingsFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
2022-04-19 18:32:39 +00:00
|
|
|
export const NAME_QUERY =
|
|
|
|
gql`
|
|
|
|
query nameAvailable($name: String!) {
|
|
|
|
nameAvailable(name: $name)
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
|
|
|
export const NAME_MUTATION =
|
|
|
|
gql`
|
|
|
|
mutation setName($name: String!) {
|
|
|
|
setName(name: $name)
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
2022-08-26 22:20:09 +00:00
|
|
|
export const USER_SEARCH =
|
|
|
|
gql`
|
|
|
|
query searchUsers($name: String!) {
|
|
|
|
searchUsers(name: $name) {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
2021-09-24 21:28:21 +00:00
|
|
|
export const USER_FIELDS = gql`
|
|
|
|
${ITEM_FIELDS}
|
|
|
|
fragment UserFields on User {
|
|
|
|
id
|
|
|
|
createdAt
|
|
|
|
name
|
|
|
|
nitems
|
|
|
|
ncomments
|
|
|
|
stacked
|
|
|
|
sats
|
2022-05-16 20:51:22 +00:00
|
|
|
photoId
|
2021-09-24 21:28:21 +00:00
|
|
|
bio {
|
|
|
|
...ItemFields
|
|
|
|
text
|
|
|
|
}
|
|
|
|
}`
|
2021-09-30 15:46:58 +00:00
|
|
|
|
2021-12-17 00:39:19 +00:00
|
|
|
export const TOP_USERS = gql`
|
2022-02-02 21:50:12 +00:00
|
|
|
query TopUsers($cursor: String, $within: String!, $userType: String!) {
|
|
|
|
topUsers(cursor: $cursor, within: $within, userType: $userType) {
|
2021-12-17 00:39:19 +00:00
|
|
|
users {
|
|
|
|
name
|
2022-02-02 21:50:12 +00:00
|
|
|
amount
|
2021-12-17 00:39:19 +00:00
|
|
|
}
|
|
|
|
cursor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
2021-10-26 20:49:37 +00:00
|
|
|
export const USER_FULL = gql`
|
2021-09-30 15:46:58 +00:00
|
|
|
${USER_FIELDS}
|
|
|
|
${ITEM_WITH_COMMENTS}
|
2021-10-26 20:49:37 +00:00
|
|
|
query User($name: String!) {
|
|
|
|
user(name: $name) {
|
2021-09-30 15:46:58 +00:00
|
|
|
...UserFields
|
|
|
|
bio {
|
|
|
|
...ItemWithComments
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|
2021-10-26 20:49:37 +00:00
|
|
|
|
|
|
|
export const USER_WITH_COMMENTS = gql`
|
|
|
|
${USER_FIELDS}
|
|
|
|
${COMMENT_FIELDS}
|
|
|
|
query UserWithComments($name: String!) {
|
|
|
|
user(name: $name) {
|
|
|
|
...UserFields
|
|
|
|
}
|
2021-12-16 23:05:31 +00:00
|
|
|
moreFlatComments(sort: "user", name: $name) {
|
2021-10-26 20:49:37 +00:00
|
|
|
cursor
|
|
|
|
comments {
|
|
|
|
...CommentFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
|
|
|
export const USER_WITH_POSTS = gql`
|
|
|
|
${USER_FIELDS}
|
|
|
|
${ITEM_FIELDS}
|
2022-02-17 17:23:43 +00:00
|
|
|
query UserWithPosts($name: String!) {
|
2021-10-26 20:49:37 +00:00
|
|
|
user(name: $name) {
|
|
|
|
...UserFields
|
|
|
|
}
|
2022-02-17 17:23:43 +00:00
|
|
|
items(sort: "user", name: $name) {
|
2021-10-26 20:49:37 +00:00
|
|
|
cursor
|
|
|
|
items {
|
|
|
|
...ItemFields
|
2022-09-06 13:01:49 +00:00
|
|
|
position
|
|
|
|
}
|
|
|
|
pins {
|
|
|
|
...ItemFields
|
|
|
|
position
|
2021-10-26 20:49:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}`
|