fix-queries

This commit is contained in:
tonyrewin 2022-11-16 10:42:43 +03:00
parent d370bc4fe4
commit b5c0eb88fe
7 changed files with 16 additions and 16 deletions

View File

@ -2,7 +2,7 @@ import { gql } from '@urql/core'
export default gql`
query LoadShoutsByQuery($by: ShoutsBy, $limit: Int!, $offset: Int!) {
loadShoutsBy(by: $by, amount: $limit, offset: $offset) {
loadShoutsBy(by: $by, limit: $limit, offset: $offset) {
_id: slug
title
subtitle

View File

@ -2,7 +2,7 @@ import { gql } from '@urql/core'
export default gql`
query AuthorLoadByQuery($by: AuthorsBy, $limit: Int, $offset: Int) {
loadAuthorsBy(by: $by, amount: $limit, offset: $offset) {
loadAuthorsBy(by: $by, limit: $limit, offset: $offset) {
_id: slug
slug
name

View File

@ -1,8 +1,8 @@
import { gql } from '@urql/core'
export default gql`
query LoadMessagesQuery($by: MessagesBy!, $amount: Int, $offset: Int) {
loadMessagesBy(by: $by, amount: $amount, offset: $offset) {
query LoadMessagesQuery($by: MessagesBy!, $limit: Int, $offset: Int) {
loadMessagesBy(by: $by, limit: $limit, offset: $offset) {
error
messages {
author

View File

@ -1,8 +1,8 @@
import { gql } from '@urql/core'
export default gql`
query GetChatsQuery {
myChats {
query GetChatsQuery($limit: Int, $offset: Int) {
loadChats(limit: $limit, offset: $offset) {
error
chats {
title

View File

@ -2,7 +2,7 @@ import { gql } from '@urql/core'
export default gql`
query LoadReactionsByQuery($by: ReactionsBy, $limit: Int!, $offset: Int!) {
loadReactionsBy(by: $by, amount: $limit, offset: $offset) {
loadReactionsBy(by: $by, limit: $limit, offset: $offset) {
id
createdBy {
slug

View File

@ -352,30 +352,30 @@ export type QueryIsEmailUsedArgs = {
}
export type QueryLoadAuthorsByArgs = {
amount?: InputMaybe<Scalars['Int']>
limit?: InputMaybe<Scalars['Int']>
by?: InputMaybe<AuthorsBy>
offset?: InputMaybe<Scalars['Int']>
}
export type QueryLoadChatsArgs = {
amount?: InputMaybe<Scalars['Int']>
limit?: InputMaybe<Scalars['Int']>
offset?: InputMaybe<Scalars['Int']>
}
export type QueryLoadMessagesByArgs = {
amount?: InputMaybe<Scalars['Int']>
limit?: InputMaybe<Scalars['Int']>
by: MessagesBy
offset?: InputMaybe<Scalars['Int']>
}
export type QueryLoadReactionsByArgs = {
amount?: InputMaybe<Scalars['Int']>
offset?: InputMaybe<Scalars['Int']>
by: ReactionBy
limit?: InputMaybe<Scalars['Int']>
}
export type QueryLoadShoutsByArgs = {
amount?: InputMaybe<Scalars['Int']>
limit?: InputMaybe<Scalars['Int']>
by?: InputMaybe<ShoutsBy>
offset?: InputMaybe<Scalars['Int']>
}
@ -385,7 +385,7 @@ export type QueryMarkdownBodyArgs = {
}
export type QuerySearchUsersArgs = {
amount?: InputMaybe<Scalars['Int']>
limit?: InputMaybe<Scalars['Int']>
offset?: InputMaybe<Scalars['Int']>
query: Scalars['String']
}

View File

@ -255,17 +255,17 @@ export const apiClient = {
getChatMessages: async ({
chat,
amount = 50,
limit = 50,
offset = 0
}: {
chat: string
amount?: number
limit?: number
offset?: number
}) => {
const by = {
chat
}
const resp = await privateGraphQLClient.query(chatMessagesLoadBy, { by, offset, amount }).toPromise()
const resp = await privateGraphQLClient.query(chatMessagesLoadBy, { by, offset, limit }).toPromise()
return resp.data.loadChat
}
}