diff --git a/src/graphql/query/articles-load-by.ts b/src/graphql/query/articles-load-by.ts index 50d4f46c..a2d0891a 100644 --- a/src/graphql/query/articles-load-by.ts +++ b/src/graphql/query/articles-load-by.ts @@ -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 diff --git a/src/graphql/query/authors-load-by.ts b/src/graphql/query/authors-load-by.ts index 710a2d3f..6463c488 100644 --- a/src/graphql/query/authors-load-by.ts +++ b/src/graphql/query/authors-load-by.ts @@ -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 diff --git a/src/graphql/query/chat-messages-load-by.ts b/src/graphql/query/chat-messages-load-by.ts index 711d7922..48796e30 100644 --- a/src/graphql/query/chat-messages-load-by.ts +++ b/src/graphql/query/chat-messages-load-by.ts @@ -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 diff --git a/src/graphql/query/chats-load.ts b/src/graphql/query/chats-load.ts index 1fb48553..de9b8610 100644 --- a/src/graphql/query/chats-load.ts +++ b/src/graphql/query/chats-load.ts @@ -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 diff --git a/src/graphql/query/reactions-load-by.ts b/src/graphql/query/reactions-load-by.ts index 3eef630f..70990f49 100644 --- a/src/graphql/query/reactions-load-by.ts +++ b/src/graphql/query/reactions-load-by.ts @@ -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 diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index eb5a07a2..a19975b9 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -352,30 +352,30 @@ export type QueryIsEmailUsedArgs = { } export type QueryLoadAuthorsByArgs = { - amount?: InputMaybe + limit?: InputMaybe by?: InputMaybe offset?: InputMaybe } export type QueryLoadChatsArgs = { - amount?: InputMaybe + limit?: InputMaybe offset?: InputMaybe } export type QueryLoadMessagesByArgs = { - amount?: InputMaybe + limit?: InputMaybe by: MessagesBy offset?: InputMaybe } export type QueryLoadReactionsByArgs = { - amount?: InputMaybe + offset?: InputMaybe by: ReactionBy limit?: InputMaybe } export type QueryLoadShoutsByArgs = { - amount?: InputMaybe + limit?: InputMaybe by?: InputMaybe offset?: InputMaybe } @@ -385,7 +385,7 @@ export type QueryMarkdownBodyArgs = { } export type QuerySearchUsersArgs = { - amount?: InputMaybe + limit?: InputMaybe offset?: InputMaybe query: Scalars['String'] } diff --git a/src/utils/apiClient.ts b/src/utils/apiClient.ts index e90b2401..e64037ef 100644 --- a/src/utils/apiClient.ts +++ b/src/utils/apiClient.ts @@ -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 } }