new-api-refactoring
This commit is contained in:
parent
d47396bb9c
commit
9164383fa3
|
@ -1,47 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query GetShoutBySlugQuery($slug: String!) {
|
|
||||||
getShoutBySlug(slug: $slug) {
|
|
||||||
_id: slug
|
|
||||||
slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
body
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
caption
|
|
||||||
}
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
publishedAt
|
|
||||||
visibility
|
|
||||||
media
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
commented
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,42 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query ShoutsForAuthorsQuery($slugs: [String]!, $limit: Int!, $offset: Int!) {
|
|
||||||
shoutsByAuthors(slugs: $slugs, limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
bio
|
|
||||||
links
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query ShoutsForCommunitiesQuery($slugs: [String]!, $limit: Int!, $offset: Int!) {
|
|
||||||
shoutsByCommunities(slugs: $slugs, limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community { ... }
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,42 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query ShoutsBySessionQuery($limit: Int!, $offset: Int!) {
|
|
||||||
shoutsForFeed(limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
commented
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query ShoutsForTopicsQuery($slugs: [String]!, $limit: Int!, $offset: Int!) {
|
|
||||||
shoutsByTopics(slugs: $slugs, limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { gql } from '@urql/core'
|
import { gql } from '@urql/core'
|
||||||
|
|
||||||
export default gql`
|
export default gql`
|
||||||
query RecentPublishedQuery($limit: Int!, $offset: Int!) {
|
query LoadShoutsByQuery($by: ShoutsBy, $limit: Int!, $offset: Int!) {
|
||||||
recentPublished(limit: $limit, offset: $offset) {
|
loadShoutsBy(by: $by, amount: $limit, offset: $offset) {
|
||||||
_id: slug
|
_id: slug
|
||||||
title
|
title
|
||||||
subtitle
|
subtitle
|
||||||
slug
|
slug
|
||||||
layout
|
layout
|
||||||
cover
|
cover
|
||||||
|
# community
|
||||||
|
mainTopic
|
||||||
topics {
|
topics {
|
||||||
title
|
title
|
||||||
body
|
body
|
||||||
|
@ -26,10 +28,8 @@ export default gql`
|
||||||
slug
|
slug
|
||||||
userpic
|
userpic
|
||||||
}
|
}
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
publishedAt
|
|
||||||
createdAt
|
createdAt
|
||||||
|
publishedAt
|
||||||
stat {
|
stat {
|
||||||
_id: viewed
|
_id: viewed
|
||||||
viewed
|
viewed
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query RecentAllQuery($limit: Int!, $offset: Int!) {
|
|
||||||
recentAll(limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
slug
|
|
||||||
layout
|
|
||||||
cover
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
createdAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query TopMonthShoutsQuery($limit: Int!, $offset: Int!) {
|
|
||||||
topMonth(limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,41 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query TopOverallShoutsQuery($limit: Int!, $offset: Int!) {
|
|
||||||
topOverall(limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
slug
|
|
||||||
layout
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,41 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query TopViewedShoutsQuery($limit: Int!, $offset: Int!) {
|
|
||||||
topViewed(limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
slug
|
|
||||||
layout
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { gql } from '@urql/core'
|
import { gql } from '@urql/core'
|
||||||
|
|
||||||
export default gql`
|
export default gql`
|
||||||
query GetAuthorsBySlugsQuery($slugs: [String]!) {
|
query AuthorLoadByQuery($by: AuthorsBy, $limit: Int, $offset: Int) {
|
||||||
getUsersBySlugs(slugs: $slugs) {
|
loadAuthorsBy(by: $by, amount: $limit, offset: $offset) {
|
||||||
_id: slug
|
_id: slug
|
||||||
slug
|
slug
|
||||||
name
|
name
|
|
@ -1,8 +1,8 @@
|
||||||
import { gql } from '@urql/core'
|
import { gql } from '@urql/core'
|
||||||
|
|
||||||
export default gql`
|
export default gql`
|
||||||
query LoadMessagesQuery($chatId: String!, $offset: Int, $amount: Int) {
|
query LoadMessagesQuery($by: MessagesBy!, $amount: Int, $offset: Int) {
|
||||||
loadChat(chatId: $chatId, offset: $offset, amount: $amount) {
|
loadMessagesBy(by: $by, amount: $amount, offset: $offset) {
|
||||||
error
|
error
|
||||||
messages {
|
messages {
|
||||||
author
|
author
|
|
@ -1,13 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query {
|
|
||||||
getMyCollections {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
desc
|
|
||||||
slug
|
|
||||||
amount
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,13 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query CollectionsUserQuery($slug: String!) {
|
|
||||||
getUserCollections(user: $slug) {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
desc
|
|
||||||
slug
|
|
||||||
amount
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query RecentShoutsForLayout($layout: String!, $amount: Int, $offset: Int) {
|
|
||||||
recentLayoutShouts(layout: $layout, amount: $amount, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query TopMonthShoutsForLayout($layout: String!, $amount: Int, $offset: Int) {
|
|
||||||
topMonthLayoutShouts(layout: $layout, amount: $amount, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,40 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query TopShoutsForLayout($layout: String!, $amount: Int, $offset: Int) {
|
|
||||||
topLayoutShouts(layout: $layout, amount: $amount, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { gql } from '@urql/core'
|
import { gql } from '@urql/core'
|
||||||
|
|
||||||
export default gql`
|
export default gql`
|
||||||
query ReactionsForShoutsQuery($shouts: [String]!, $limit: Int!, $offset: Int!) {
|
query LoadReactionsByQuery($by: ReactionsBy, $limit: Int!, $offset: Int!) {
|
||||||
reactionsForShouts(shouts: $shouts, limit: $limit, offset: $offset) {
|
loadReactionsBy(by: $by, amount: $limit, offset: $offset) {
|
||||||
id
|
id
|
||||||
createdBy {
|
createdBy {
|
||||||
slug
|
slug
|
|
@ -1,42 +0,0 @@
|
||||||
import { gql } from '@urql/core'
|
|
||||||
|
|
||||||
export default gql`
|
|
||||||
query SearchResultsQuery($q: String!, $limit: Int!, $offset: Int!) {
|
|
||||||
searchQuery(q: $q, limit: $limit, offset: $offset) {
|
|
||||||
_id: slug
|
|
||||||
title
|
|
||||||
subtitle
|
|
||||||
layout
|
|
||||||
slug
|
|
||||||
cover
|
|
||||||
# community
|
|
||||||
mainTopic
|
|
||||||
topics {
|
|
||||||
title
|
|
||||||
body
|
|
||||||
slug
|
|
||||||
stat {
|
|
||||||
_id: shouts
|
|
||||||
shouts
|
|
||||||
authors
|
|
||||||
followers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
authors {
|
|
||||||
_id: slug
|
|
||||||
name
|
|
||||||
slug
|
|
||||||
userpic
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
publishedAt
|
|
||||||
stat {
|
|
||||||
_id: viewed
|
|
||||||
viewed
|
|
||||||
reacted
|
|
||||||
rating
|
|
||||||
commented
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
|
@ -41,6 +41,17 @@ export type AuthorStat = {
|
||||||
rating?: Maybe<Scalars['Int']>
|
rating?: Maybe<Scalars['Int']>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AuthorsBy = {
|
||||||
|
createdAt?: InputMaybe<Scalars['DateTime']>
|
||||||
|
days?: InputMaybe<Scalars['Int']>
|
||||||
|
lastSeen?: InputMaybe<Scalars['DateTime']>
|
||||||
|
name?: InputMaybe<Scalars['String']>
|
||||||
|
order?: InputMaybe<Scalars['String']>
|
||||||
|
slug?: InputMaybe<Scalars['String']>
|
||||||
|
stat?: InputMaybe<Scalars['String']>
|
||||||
|
topic?: InputMaybe<Scalars['String']>
|
||||||
|
}
|
||||||
|
|
||||||
export type Chat = {
|
export type Chat = {
|
||||||
admins?: Maybe<Array<Maybe<User>>>
|
admins?: Maybe<Array<Maybe<User>>>
|
||||||
createdAt: Scalars['Int']
|
createdAt: Scalars['Int']
|
||||||
|
@ -88,12 +99,6 @@ export type Collection = {
|
||||||
title: Scalars['String']
|
title: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CollectionInput = {
|
|
||||||
desc?: InputMaybe<Scalars['String']>
|
|
||||||
pic?: InputMaybe<Scalars['String']>
|
|
||||||
title: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Community = {
|
export type Community = {
|
||||||
createdAt: Scalars['DateTime']
|
createdAt: Scalars['DateTime']
|
||||||
createdBy: User
|
createdBy: User
|
||||||
|
@ -104,12 +109,6 @@ export type Community = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CommunityInput = {
|
|
||||||
desc?: InputMaybe<Scalars['String']>
|
|
||||||
pic?: InputMaybe<Scalars['String']>
|
|
||||||
title: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum FollowingEntity {
|
export enum FollowingEntity {
|
||||||
Author = 'AUTHOR',
|
Author = 'AUTHOR',
|
||||||
Community = 'COMMUNITY',
|
Community = 'COMMUNITY',
|
||||||
|
@ -133,25 +132,28 @@ export enum MessageStatus {
|
||||||
Updated = 'UPDATED'
|
Updated = 'UPDATED'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type MessagesBy = {
|
||||||
|
author?: InputMaybe<Scalars['String']>
|
||||||
|
body?: InputMaybe<Scalars['String']>
|
||||||
|
chat?: InputMaybe<Scalars['String']>
|
||||||
|
days?: InputMaybe<Scalars['Int']>
|
||||||
|
order?: InputMaybe<Scalars['String']>
|
||||||
|
stat?: InputMaybe<Scalars['String']>
|
||||||
|
}
|
||||||
|
|
||||||
export type Mutation = {
|
export type Mutation = {
|
||||||
confirmEmail: AuthResult
|
confirmEmail: AuthResult
|
||||||
createChat: Result
|
createChat: Result
|
||||||
createCollection: Result
|
|
||||||
createCommunity: Result
|
|
||||||
createMessage: Result
|
createMessage: Result
|
||||||
createReaction: Result
|
createReaction: Result
|
||||||
createShout: Result
|
createShout: Result
|
||||||
createTopic: Result
|
createTopic: Result
|
||||||
deleteChat: Result
|
deleteChat: Result
|
||||||
deleteCollection: Result
|
|
||||||
deleteCommunity: Result
|
|
||||||
deleteMessage: Result
|
deleteMessage: Result
|
||||||
deleteReaction: Result
|
deleteReaction: Result
|
||||||
deleteShout: Result
|
deleteShout: Result
|
||||||
destroyTopic: Result
|
destroyTopic: Result
|
||||||
enterChat: Result
|
|
||||||
follow: Result
|
follow: Result
|
||||||
incrementView: Result
|
|
||||||
inviteAuthor: Result
|
inviteAuthor: Result
|
||||||
inviteChat: Result
|
inviteChat: Result
|
||||||
markAsRead: Result
|
markAsRead: Result
|
||||||
|
@ -162,9 +164,8 @@ export type Mutation = {
|
||||||
sendLink: Result
|
sendLink: Result
|
||||||
unfollow: Result
|
unfollow: Result
|
||||||
updateChat: Result
|
updateChat: Result
|
||||||
updateCollection: Result
|
|
||||||
updateCommunity: Result
|
|
||||||
updateMessage: Result
|
updateMessage: Result
|
||||||
|
updateOnlineStatus: Result
|
||||||
updateProfile: Result
|
updateProfile: Result
|
||||||
updateReaction: Result
|
updateReaction: Result
|
||||||
updateShout: Result
|
updateShout: Result
|
||||||
|
@ -180,14 +181,6 @@ export type MutationCreateChatArgs = {
|
||||||
title?: InputMaybe<Scalars['String']>
|
title?: InputMaybe<Scalars['String']>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MutationCreateCollectionArgs = {
|
|
||||||
collection: CollectionInput
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationCreateCommunityArgs = {
|
|
||||||
community: CommunityInput
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationCreateMessageArgs = {
|
export type MutationCreateMessageArgs = {
|
||||||
body: Scalars['String']
|
body: Scalars['String']
|
||||||
chatId: Scalars['String']
|
chatId: Scalars['String']
|
||||||
|
@ -210,14 +203,6 @@ export type MutationDeleteChatArgs = {
|
||||||
chatId: Scalars['String']
|
chatId: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MutationDeleteCollectionArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationDeleteCommunityArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationDeleteMessageArgs = {
|
export type MutationDeleteMessageArgs = {
|
||||||
chatId: Scalars['String']
|
chatId: Scalars['String']
|
||||||
id: Scalars['Int']
|
id: Scalars['Int']
|
||||||
|
@ -235,19 +220,11 @@ export type MutationDestroyTopicArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MutationEnterChatArgs = {
|
|
||||||
chatId: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationFollowArgs = {
|
export type MutationFollowArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
what: FollowingEntity
|
what: FollowingEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MutationIncrementViewArgs = {
|
|
||||||
shout: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationInviteAuthorArgs = {
|
export type MutationInviteAuthorArgs = {
|
||||||
author: Scalars['String']
|
author: Scalars['String']
|
||||||
shout: Scalars['String']
|
shout: Scalars['String']
|
||||||
|
@ -293,14 +270,6 @@ export type MutationUpdateChatArgs = {
|
||||||
chat: ChatInput
|
chat: ChatInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MutationUpdateCollectionArgs = {
|
|
||||||
collection: CollectionInput
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationUpdateCommunityArgs = {
|
|
||||||
community: CommunityInput
|
|
||||||
}
|
|
||||||
|
|
||||||
export type MutationUpdateMessageArgs = {
|
export type MutationUpdateMessageArgs = {
|
||||||
body: Scalars['String']
|
body: Scalars['String']
|
||||||
chatId: Scalars['String']
|
chatId: Scalars['String']
|
||||||
|
@ -348,98 +317,66 @@ export type ProfileInput = {
|
||||||
|
|
||||||
export type Query = {
|
export type Query = {
|
||||||
authorsAll: Array<Maybe<Author>>
|
authorsAll: Array<Maybe<Author>>
|
||||||
collectionsAll: Array<Maybe<Collection>>
|
|
||||||
getAuthor: User
|
getAuthor: User
|
||||||
getCollabs: Array<Maybe<Collab>>
|
getCollabs: Array<Maybe<Collab>>
|
||||||
getCommunities: Array<Maybe<Community>>
|
|
||||||
getCommunity: Community
|
|
||||||
getShoutBySlug: Shout
|
|
||||||
getTopic: Topic
|
getTopic: Topic
|
||||||
getUserCollections: Array<Maybe<Collection>>
|
|
||||||
getUserRoles: Array<Maybe<Role>>
|
|
||||||
getUsersBySlugs: Array<Maybe<Author>>
|
|
||||||
isEmailUsed: Scalars['Boolean']
|
isEmailUsed: Scalars['Boolean']
|
||||||
|
loadAuthorsBy: Array<Maybe<Author>>
|
||||||
loadChats: Result
|
loadChats: Result
|
||||||
loadMessages: Result
|
loadMessagesBy: Result
|
||||||
|
loadReactionsBy: Array<Maybe<Reaction>>
|
||||||
|
loadShoutsBy: Array<Maybe<Shout>>
|
||||||
markdownBody: Scalars['String']
|
markdownBody: Scalars['String']
|
||||||
reactionsByAuthor: Array<Maybe<Reaction>>
|
|
||||||
reactionsForShouts: Array<Maybe<Reaction>>
|
|
||||||
recentAll: Array<Maybe<Shout>>
|
|
||||||
recentCandidates: Array<Maybe<Shout>>
|
|
||||||
recentCommented: Array<Maybe<Shout>>
|
|
||||||
recentLayoutShouts: Array<Maybe<Shout>>
|
|
||||||
recentPublished: Array<Maybe<Shout>>
|
|
||||||
recentReacted: Array<Maybe<Shout>>
|
|
||||||
searchChats: Result
|
|
||||||
searchMessages: Result
|
|
||||||
searchQuery?: Maybe<Array<Maybe<Shout>>>
|
|
||||||
searchUsers: Result
|
searchUsers: Result
|
||||||
shoutsByAuthors: Array<Maybe<Shout>>
|
|
||||||
shoutsByCollection: Array<Maybe<Shout>>
|
|
||||||
shoutsByCommunities: Array<Maybe<Shout>>
|
|
||||||
shoutsByLayout: Array<Maybe<Shout>>
|
|
||||||
shoutsByTopics: Array<Maybe<Shout>>
|
|
||||||
shoutsForFeed: Array<Maybe<Shout>>
|
|
||||||
signIn: AuthResult
|
signIn: AuthResult
|
||||||
signOut: AuthResult
|
signOut: AuthResult
|
||||||
topAuthors: Array<Maybe<Author>>
|
|
||||||
topCommented: Array<Maybe<Shout>>
|
|
||||||
topLayoutShouts: Array<Maybe<Shout>>
|
|
||||||
topMonth: Array<Maybe<Shout>>
|
|
||||||
topMonthLayoutShouts: Array<Maybe<Shout>>
|
|
||||||
topOverall: Array<Maybe<Shout>>
|
|
||||||
topPublished: Array<Maybe<Shout>>
|
|
||||||
topicsAll: Array<Maybe<Topic>>
|
topicsAll: Array<Maybe<Topic>>
|
||||||
topicsByAuthor: Array<Maybe<Topic>>
|
topicsByAuthor: Array<Maybe<Topic>>
|
||||||
topicsByCommunity: Array<Maybe<Topic>>
|
topicsByCommunity: Array<Maybe<Topic>>
|
||||||
topicsRandom: Array<Maybe<Topic>>
|
topicsRandom: Array<Maybe<Topic>>
|
||||||
userFollowedAuthors: Array<Maybe<Author>>
|
userFollowedAuthors: Array<Maybe<Author>>
|
||||||
userFollowedCommunities: Array<Maybe<Community>>
|
|
||||||
userFollowedTopics: Array<Maybe<Topic>>
|
userFollowedTopics: Array<Maybe<Topic>>
|
||||||
userFollowers: Array<Maybe<Author>>
|
userFollowers: Array<Maybe<Author>>
|
||||||
userReactedShouts: Array<Maybe<Shout>>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryGetAuthorArgs = {
|
export type QueryGetAuthorArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryGetCommunityArgs = {
|
|
||||||
slug?: InputMaybe<Scalars['String']>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryGetShoutBySlugArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryGetTopicArgs = {
|
export type QueryGetTopicArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryGetUserCollectionsArgs = {
|
|
||||||
author: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryGetUserRolesArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryGetUsersBySlugsArgs = {
|
|
||||||
slugs: Array<InputMaybe<Scalars['String']>>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryIsEmailUsedArgs = {
|
export type QueryIsEmailUsedArgs = {
|
||||||
email: Scalars['String']
|
email: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type QueryLoadAuthorsByArgs = {
|
||||||
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
|
by?: InputMaybe<AuthorsBy>
|
||||||
|
offset?: InputMaybe<Scalars['Int']>
|
||||||
|
}
|
||||||
|
|
||||||
export type QueryLoadChatsArgs = {
|
export type QueryLoadChatsArgs = {
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
offset?: InputMaybe<Scalars['Int']>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryLoadMessagesArgs = {
|
export type QueryLoadMessagesByArgs = {
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
chatId: Scalars['String']
|
by: MessagesBy
|
||||||
|
offset?: InputMaybe<Scalars['Int']>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type QueryLoadReactionsByArgs = {
|
||||||
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
|
by: ReactionBy
|
||||||
|
limit?: InputMaybe<Scalars['Int']>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type QueryLoadShoutsByArgs = {
|
||||||
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
|
by?: InputMaybe<ShoutsBy>
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
offset?: InputMaybe<Scalars['Int']>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,106 +384,10 @@ export type QueryMarkdownBodyArgs = {
|
||||||
body: Scalars['String']
|
body: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryReactionsByAuthorArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryReactionsForShoutsArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
shouts: Array<InputMaybe<Scalars['String']>>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentAllArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentCandidatesArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentCommentedArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentLayoutShoutsArgs = {
|
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
|
||||||
layout: Scalars['String']
|
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentPublishedArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryRecentReactedArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QuerySearchChatsArgs = {
|
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
|
||||||
q: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QuerySearchMessagesArgs = {
|
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
|
||||||
q: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QuerySearchQueryArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
q?: InputMaybe<Scalars['String']>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QuerySearchUsersArgs = {
|
export type QuerySearchUsersArgs = {
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
amount?: InputMaybe<Scalars['Int']>
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
offset?: InputMaybe<Scalars['Int']>
|
||||||
q: Scalars['String']
|
query: Scalars['String']
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsByAuthorsArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
slugs: Array<InputMaybe<Scalars['String']>>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsByCollectionArgs = {
|
|
||||||
collection: Scalars['String']
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsByCommunitiesArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
slugs: Array<InputMaybe<Scalars['String']>>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsByLayoutArgs = {
|
|
||||||
amount: Scalars['Int']
|
|
||||||
layout?: InputMaybe<Scalars['String']>
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsByTopicsArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
slugs: Array<InputMaybe<Scalars['String']>>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryShoutsForFeedArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QuerySignInArgs = {
|
export type QuerySignInArgs = {
|
||||||
|
@ -555,44 +396,6 @@ export type QuerySignInArgs = {
|
||||||
password?: InputMaybe<Scalars['String']>
|
password?: InputMaybe<Scalars['String']>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryTopAuthorsArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopCommentedArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopLayoutShoutsArgs = {
|
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
|
||||||
layout: Scalars['String']
|
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopMonthArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopMonthLayoutShoutsArgs = {
|
|
||||||
amount?: InputMaybe<Scalars['Int']>
|
|
||||||
layout: Scalars['String']
|
|
||||||
offset?: InputMaybe<Scalars['Int']>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopOverallArgs = {
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopPublishedArgs = {
|
|
||||||
daysago: Scalars['Int']
|
|
||||||
limit: Scalars['Int']
|
|
||||||
offset: Scalars['Int']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryTopicsByAuthorArgs = {
|
export type QueryTopicsByAuthorArgs = {
|
||||||
author: Scalars['String']
|
author: Scalars['String']
|
||||||
}
|
}
|
||||||
|
@ -609,10 +412,6 @@ export type QueryUserFollowedAuthorsArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryUserFollowedCommunitiesArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type QueryUserFollowedTopicsArgs = {
|
export type QueryUserFollowedTopicsArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
@ -621,10 +420,6 @@ export type QueryUserFollowersArgs = {
|
||||||
slug: Scalars['String']
|
slug: Scalars['String']
|
||||||
}
|
}
|
||||||
|
|
||||||
export type QueryUserReactedShoutsArgs = {
|
|
||||||
slug: Scalars['String']
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Rating = {
|
export type Rating = {
|
||||||
rater: Scalars['String']
|
rater: Scalars['String']
|
||||||
value: Scalars['Int']
|
value: Scalars['Int']
|
||||||
|
@ -647,6 +442,16 @@ export type Reaction = {
|
||||||
updatedAt?: Maybe<Scalars['DateTime']>
|
updatedAt?: Maybe<Scalars['DateTime']>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ReactionBy = {
|
||||||
|
author?: InputMaybe<Scalars['String']>
|
||||||
|
body?: InputMaybe<Scalars['String']>
|
||||||
|
days?: InputMaybe<Scalars['Int']>
|
||||||
|
order?: InputMaybe<Scalars['String']>
|
||||||
|
shout?: InputMaybe<Scalars['String']>
|
||||||
|
stat?: InputMaybe<Scalars['String']>
|
||||||
|
topic?: InputMaybe<Scalars['String']>
|
||||||
|
}
|
||||||
|
|
||||||
export type ReactionInput = {
|
export type ReactionInput = {
|
||||||
body?: InputMaybe<Scalars['String']>
|
body?: InputMaybe<Scalars['String']>
|
||||||
kind: Scalars['Int']
|
kind: Scalars['Int']
|
||||||
|
@ -757,6 +562,20 @@ export type ShoutInput = {
|
||||||
visibleForUsers?: InputMaybe<Array<InputMaybe<Scalars['String']>>>
|
visibleForUsers?: InputMaybe<Array<InputMaybe<Scalars['String']>>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ShoutsBy = {
|
||||||
|
author?: InputMaybe<Scalars['String']>
|
||||||
|
body?: InputMaybe<Scalars['String']>
|
||||||
|
days?: InputMaybe<Scalars['Int']>
|
||||||
|
layout?: InputMaybe<Scalars['String']>
|
||||||
|
order?: InputMaybe<Scalars['String']>
|
||||||
|
published?: InputMaybe<Scalars['Boolean']>
|
||||||
|
slug?: InputMaybe<Scalars['String']>
|
||||||
|
stat?: InputMaybe<Scalars['String']>
|
||||||
|
title?: InputMaybe<Scalars['String']>
|
||||||
|
topic?: InputMaybe<Scalars['String']>
|
||||||
|
visibility?: InputMaybe<Scalars['String']>
|
||||||
|
}
|
||||||
|
|
||||||
export type Stat = {
|
export type Stat = {
|
||||||
commented?: Maybe<Scalars['Int']>
|
commented?: Maybe<Scalars['Int']>
|
||||||
ranking?: Maybe<Scalars['Int']>
|
ranking?: Maybe<Scalars['Int']>
|
||||||
|
|
|
@ -9,11 +9,8 @@ import type {
|
||||||
} from '../graphql/types.gen'
|
} from '../graphql/types.gen'
|
||||||
import { publicGraphQLClient } from '../graphql/publicGraphQLClient'
|
import { publicGraphQLClient } from '../graphql/publicGraphQLClient'
|
||||||
import { getToken, privateGraphQLClient } from '../graphql/privateGraphQLClient'
|
import { getToken, privateGraphQLClient } from '../graphql/privateGraphQLClient'
|
||||||
import articleBySlug from '../graphql/query/article-by-slug'
|
|
||||||
import articlesRecentAll from '../graphql/query/articles-recent-all'
|
|
||||||
import articlesRecentPublished from '../graphql/query/articles-recent-published'
|
|
||||||
import topicsAll from '../graphql/query/topics-all'
|
import topicsAll from '../graphql/query/topics-all'
|
||||||
import reactionsForShouts from '../graphql/query/reactions-for-shouts'
|
import reactionsForShouts from '../graphql/query/reactions-load-by'
|
||||||
import mySession from '../graphql/mutation/my-session'
|
import mySession from '../graphql/mutation/my-session'
|
||||||
import authLogoutQuery from '../graphql/mutation/auth-logout'
|
import authLogoutQuery from '../graphql/mutation/auth-logout'
|
||||||
import authLoginQuery from '../graphql/query/auth-login'
|
import authLoginQuery from '../graphql/query/auth-login'
|
||||||
|
@ -23,26 +20,20 @@ import authConfirmEmailMutation from '../graphql/mutation/auth-confirm-email'
|
||||||
import authSendLinkMutation from '../graphql/mutation/auth-send-link'
|
import authSendLinkMutation from '../graphql/mutation/auth-send-link'
|
||||||
import followMutation from '../graphql/mutation/follow'
|
import followMutation from '../graphql/mutation/follow'
|
||||||
import unfollowMutation from '../graphql/mutation/unfollow'
|
import unfollowMutation from '../graphql/mutation/unfollow'
|
||||||
import articlesForAuthors from '../graphql/query/articles-for-authors'
|
|
||||||
import articlesForTopics from '../graphql/query/articles-for-topics'
|
|
||||||
import searchResults from '../graphql/query/search-results'
|
|
||||||
import topicsRandomQuery from '../graphql/query/topics-random'
|
import topicsRandomQuery from '../graphql/query/topics-random'
|
||||||
import articlesTopMonth from '../graphql/query/articles-top-month'
|
|
||||||
import articlesTopRated from '../graphql/query/articles-top-rated'
|
|
||||||
import authorsAll from '../graphql/query/authors-all'
|
import authorsAll from '../graphql/query/authors-all'
|
||||||
import reactionCreate from '../graphql/mutation/reaction-create'
|
import reactionCreate from '../graphql/mutation/reaction-create'
|
||||||
import reactionDestroy from '../graphql/mutation/reaction-destroy'
|
import reactionDestroy from '../graphql/mutation/reaction-destroy'
|
||||||
import reactionUpdate from '../graphql/mutation/reaction-update'
|
import reactionUpdate from '../graphql/mutation/reaction-update'
|
||||||
import incrementView from '../graphql/mutation/increment-view'
|
import incrementView from '../graphql/mutation/increment-view'
|
||||||
import createArticle from '../graphql/mutation/article-create'
|
import createArticle from '../graphql/mutation/article-create'
|
||||||
import myChats from '../graphql/query/im-chats'
|
import myChats from '../graphql/query/chats-load'
|
||||||
import loadChat from '../graphql/query/im-load-messages'
|
import loadChat from '../graphql/query/chat-messages-load-by'
|
||||||
import getRecentByLayout from '../graphql/query/layout-recent'
|
|
||||||
import getTopByLayout from '../graphql/query/layout-top'
|
|
||||||
import getTopMonthByLayout from '../graphql/query/layout-top-month'
|
|
||||||
import type { LayoutType } from '../stores/zine/layouts'
|
|
||||||
import topicBySlug from '../graphql/query/topic-by-slug'
|
import topicBySlug from '../graphql/query/topic-by-slug'
|
||||||
import authorBySlug from '../graphql/query/author-by-slug'
|
import authorBySlug from '../graphql/query/author-by-slug'
|
||||||
|
import shoutsLoadBy from '../graphql/query/articles-load-by'
|
||||||
|
import reactionsLoadBy from '../graphql/query/reactions-load-by'
|
||||||
|
import authorsLoadBy from '../graphql/query/authors-load-by'
|
||||||
|
|
||||||
const FEED_SIZE = 50
|
const FEED_SIZE = 50
|
||||||
|
|
||||||
|
@ -157,12 +148,21 @@ export const apiClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getTopArticles: async () => {
|
getTopArticles: async () => {
|
||||||
const response = await publicGraphQLClient.query(articlesTopRated, { limit: 10, offset: 0 }).toPromise()
|
const by = {
|
||||||
return response.data.topOverall
|
stat: 'rating',
|
||||||
|
visibility: 'public'
|
||||||
|
}
|
||||||
|
const response = await publicGraphQLClient.query(shoutsLoadBy, { by, limit: 10, offset: 0 }).toPromise()
|
||||||
|
return response.data.loadShoutsBy
|
||||||
},
|
},
|
||||||
getTopMonthArticles: async () => {
|
getTopMonthArticles: async () => {
|
||||||
const response = await publicGraphQLClient.query(articlesTopMonth, { limit: 10, offset: 0 }).toPromise()
|
const by = {
|
||||||
return response.data.topMonth
|
stat: 'rating',
|
||||||
|
visibility: 'public',
|
||||||
|
days: 30
|
||||||
|
}
|
||||||
|
const response = await publicGraphQLClient.query(shoutsLoadBy, { by, limit: 10, offset: 0 }).toPromise()
|
||||||
|
return response.data.loadShoutsBy
|
||||||
},
|
},
|
||||||
getRecentPublishedArticles: async ({
|
getRecentPublishedArticles: async ({
|
||||||
limit = FEED_SIZE,
|
limit = FEED_SIZE,
|
||||||
|
@ -171,9 +171,12 @@ export const apiClient = {
|
||||||
limit?: number
|
limit?: number
|
||||||
offset?: number
|
offset?: number
|
||||||
}) => {
|
}) => {
|
||||||
const response = await publicGraphQLClient.query(articlesRecentPublished, { limit, offset }).toPromise()
|
const by = {
|
||||||
|
visibility: 'public'
|
||||||
|
}
|
||||||
|
const response = await publicGraphQLClient.query(shoutsLoadBy, { by, limit, offset }).toPromise()
|
||||||
|
|
||||||
return response.data.recentPublished
|
return response.data.loadShoutsBy
|
||||||
},
|
},
|
||||||
getRandomTopics: async ({ amount }: { amount: number }) => {
|
getRandomTopics: async ({ amount }: { amount: number }) => {
|
||||||
const response = await publicGraphQLClient.query(topicsRandomQuery, { amount }).toPromise()
|
const response = await publicGraphQLClient.query(topicsRandomQuery, { amount }).toPromise()
|
||||||
|
@ -187,17 +190,19 @@ export const apiClient = {
|
||||||
getSearchResults: async ({
|
getSearchResults: async ({
|
||||||
query,
|
query,
|
||||||
limit = FEED_SIZE,
|
limit = FEED_SIZE,
|
||||||
offset = 0,
|
offset = 0
|
||||||
layout = 'literature'
|
|
||||||
}: {
|
}: {
|
||||||
query: string
|
query: string
|
||||||
limit: number
|
limit: number
|
||||||
offset?: number
|
offset?: number
|
||||||
layout?: LayoutType
|
|
||||||
}): Promise<Shout[]> => {
|
}): Promise<Shout[]> => {
|
||||||
|
const by = {
|
||||||
|
title: query,
|
||||||
|
body: query
|
||||||
|
}
|
||||||
const response = await publicGraphQLClient
|
const response = await publicGraphQLClient
|
||||||
.query(searchResults, {
|
.query(shoutsLoadBy, {
|
||||||
q: query,
|
by,
|
||||||
limit,
|
limit,
|
||||||
offset
|
offset
|
||||||
})
|
})
|
||||||
|
@ -213,7 +218,8 @@ export const apiClient = {
|
||||||
offset?: number
|
offset?: number
|
||||||
}): Promise<Shout[]> => {
|
}): Promise<Shout[]> => {
|
||||||
const response = await publicGraphQLClient
|
const response = await publicGraphQLClient
|
||||||
.query(articlesRecentAll, {
|
.query(shoutsLoadBy, {
|
||||||
|
by: {},
|
||||||
limit,
|
limit,
|
||||||
offset
|
offset
|
||||||
})
|
})
|
||||||
|
@ -230,9 +236,13 @@ export const apiClient = {
|
||||||
limit: number
|
limit: number
|
||||||
offset?: number
|
offset?: number
|
||||||
}): Promise<Shout[]> => {
|
}): Promise<Shout[]> => {
|
||||||
|
const by = {
|
||||||
|
topics: topicSlugs,
|
||||||
|
visibility: 'public'
|
||||||
|
}
|
||||||
const response = await publicGraphQLClient
|
const response = await publicGraphQLClient
|
||||||
.query(articlesForTopics, {
|
.query(shoutsLoadBy, {
|
||||||
slugs: topicSlugs,
|
by,
|
||||||
limit,
|
limit,
|
||||||
offset
|
offset
|
||||||
})
|
})
|
||||||
|
@ -253,13 +263,17 @@ export const apiClient = {
|
||||||
limit: number
|
limit: number
|
||||||
offset?: number
|
offset?: number
|
||||||
}): Promise<Shout[]> => {
|
}): Promise<Shout[]> => {
|
||||||
|
const by = {
|
||||||
|
authors: authorSlugs,
|
||||||
|
visibility: 'public'
|
||||||
|
}
|
||||||
const vars = {
|
const vars = {
|
||||||
slugs: authorSlugs,
|
by,
|
||||||
limit,
|
limit,
|
||||||
offset
|
offset
|
||||||
}
|
}
|
||||||
console.debug(vars)
|
// console.debug(vars)
|
||||||
const response = await publicGraphQLClient.query(articlesForAuthors, vars).toPromise()
|
const response = await publicGraphQLClient.query(shoutsLoadBy, vars).toPromise()
|
||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error('[api-client] getArticlesForAuthors', response.error)
|
console.error('[api-client] getArticlesForAuthors', response.error)
|
||||||
|
@ -298,7 +312,10 @@ export const apiClient = {
|
||||||
return response.data.refreshSession
|
return response.data.refreshSession
|
||||||
},
|
},
|
||||||
getPublishedArticles: async ({ limit = FEED_SIZE, offset }: { limit?: number; offset?: number }) => {
|
getPublishedArticles: async ({ limit = FEED_SIZE, offset }: { limit?: number; offset?: number }) => {
|
||||||
const response = await publicGraphQLClient.query(articlesRecentPublished, { limit, offset }).toPromise()
|
const by = {
|
||||||
|
visibility: 'public'
|
||||||
|
}
|
||||||
|
const response = await publicGraphQLClient.query(shoutsLoadBy, { by, limit, offset }).toPromise()
|
||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error('[api-client] getPublishedArticles', response.error)
|
console.error('[api-client] getPublishedArticles', response.error)
|
||||||
|
@ -329,7 +346,9 @@ export const apiClient = {
|
||||||
return response.data.getTopic
|
return response.data.getTopic
|
||||||
},
|
},
|
||||||
getArticle: async ({ slug }: { slug: string }): Promise<Shout> => {
|
getArticle: async ({ slug }: { slug: string }): Promise<Shout> => {
|
||||||
const response = await publicGraphQLClient.query(articleBySlug, { slug }).toPromise()
|
const response = await publicGraphQLClient
|
||||||
|
.query(shoutsLoadBy, { by: { slug }, amount: 1, offset: 0 })
|
||||||
|
.toPromise()
|
||||||
return response.data?.getShoutBySlug
|
return response.data?.getShoutBySlug
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -382,29 +401,44 @@ export const apiClient = {
|
||||||
return resp.data.myChats
|
return resp.data.myChats
|
||||||
},
|
},
|
||||||
getRecentLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
getRecentLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
||||||
const resp = await publicGraphQLClient.query(getRecentByLayout, { amount, offset, layout }).toPromise()
|
const by = {
|
||||||
|
layout
|
||||||
|
}
|
||||||
|
const resp = await publicGraphQLClient.query(shoutsLoadBy, { by, amount, offset }).toPromise()
|
||||||
return resp.data.recentLayoutShouts
|
return resp.data.recentLayoutShouts
|
||||||
},
|
},
|
||||||
getTopLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
getTopLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
||||||
const resp = await publicGraphQLClient.query(getTopByLayout, { amount, offset, layout }).toPromise()
|
const by = {
|
||||||
|
layout,
|
||||||
|
stat: 'rating',
|
||||||
|
order: 'rating'
|
||||||
|
}
|
||||||
|
const resp = await publicGraphQLClient.query(shoutsLoadBy, { by, amount, offset }).toPromise()
|
||||||
return resp.data.topLayoutShouts
|
return resp.data.topLayoutShouts
|
||||||
},
|
},
|
||||||
getTopMonthLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
getTopMonthLayoutShouts: async ({ layout = 'article', amount = 50, offset = 0 }) => {
|
||||||
const resp = await publicGraphQLClient
|
const by = {
|
||||||
.query(getTopMonthByLayout, { amount, offset, layout })
|
layout,
|
||||||
.toPromise()
|
stat: 'rating',
|
||||||
|
order: 'rating',
|
||||||
|
days: 30
|
||||||
|
}
|
||||||
|
const resp = await publicGraphQLClient.query(shoutsLoadBy, { amount, offset, layout }).toPromise()
|
||||||
return resp.data.topMonthLayoutShouts
|
return resp.data.topMonthLayoutShouts
|
||||||
},
|
},
|
||||||
getChatMessages: async ({
|
getChatMessages: async ({
|
||||||
chatId,
|
chat,
|
||||||
offset = 0,
|
amount = 50,
|
||||||
amount = 50
|
offset = 0
|
||||||
}: {
|
}: {
|
||||||
chatId: string
|
chat: string
|
||||||
offset?: number
|
|
||||||
amount?: number
|
amount?: number
|
||||||
|
offset?: number
|
||||||
}) => {
|
}) => {
|
||||||
const resp = await privateGraphQLClient.query(loadChat, { chatId, offset, amount }).toPromise()
|
const by = {
|
||||||
|
chat
|
||||||
|
}
|
||||||
|
const resp = await privateGraphQLClient.query(loadChat, { by, offset, amount }).toPromise()
|
||||||
return resp.data.loadChat
|
return resp.data.loadChat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user