From 29bb806ad70b617ffe54dc7bd5accd901febaf7f Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Thu, 17 Jun 2021 22:38:46 +0100 Subject: [PATCH] Update gql types and operations --- src/graphql/chat.api.support.ts | 28 ++--------------- src/graphql/types.support.ts | 56 ++++++++++----------------------- 2 files changed, 18 insertions(+), 66 deletions(-) diff --git a/src/graphql/chat.api.support.ts b/src/graphql/chat.api.support.ts index 1c0417d..f1d61eb 100644 --- a/src/graphql/chat.api.support.ts +++ b/src/graphql/chat.api.support.ts @@ -7,13 +7,8 @@ export const GET_PROJECT_THREADS = gql` title threadDescription userMessages { - id username text - attachment { - name - src - } } } } @@ -26,13 +21,8 @@ export const GET_THREAD_BY_ID = gql` title threadDescription userMessages { - id username text - attachment { - name - src - } } } } @@ -41,13 +31,8 @@ export const GET_THREAD_BY_ID = gql` export const MESSAGES = gql` query Messages($threadId: String!) { messages(threadId: $threadId) { - id username text - attachment { - name - src - } } } `; @@ -67,13 +52,8 @@ export const CREATE_THREAD = gql` `; export const SEND_MSG = gql` - mutation SendMsg( - $threadId: String! - $username: String! - $msg: String - $file: FileInput - ) { - sendMsg(threadId: $threadId, username: $username, msg: $msg, file: $file) + mutation SendMsg($threadId: String!, $username: String!, $msg: String!) { + sendMsg(threadId: $threadId, username: $username, msg: $msg) } `; @@ -86,10 +66,6 @@ export const CONNECT_STREAM = gql` id username text - attachment { - name - src - } } } } diff --git a/src/graphql/types.support.ts b/src/graphql/types.support.ts index 4510d3f..9203ece 100644 --- a/src/graphql/types.support.ts +++ b/src/graphql/types.support.ts @@ -12,17 +12,6 @@ export type Scalars = { }; -export type FileInput = { - name: Scalars['String']; - src: Scalars['String']; -}; - -export type FileOutput = { - __typename?: 'FileOutput'; - name: Scalars['String']; - src: Scalars['String']; -}; - export type MutationRoot = { __typename?: 'MutationRoot'; createThread: Scalars['ID']; @@ -46,8 +35,7 @@ export type MutationRootDeleteThreadArgs = { export type MutationRootSendMsgArgs = { threadId: Scalars['String']; username: Scalars['String']; - msg?: Maybe; - file?: Maybe; + msg: Scalars['String']; }; export type MutationType = @@ -55,7 +43,7 @@ export type MutationType = export type QueryRoot = { __typename?: 'QueryRoot'; - messages: Array; + messages: Array; getProjectThreads: Array; getThreadById: ThreadObject; }; @@ -97,7 +85,13 @@ export type ThreadObject = { id: Scalars['String']; title: Scalars['String']; threadDescription: Scalars['String']; - userMessages: Array; + userMessages: Array; +}; + +export type UserMessage = { + __typename?: 'UserMessage'; + username: Scalars['String']; + text: Scalars['String']; }; export type UserMessageObject = { @@ -105,7 +99,6 @@ export type UserMessageObject = { id: Scalars['String']; username: Scalars['String']; text: Scalars['String']; - attachment: FileOutput; }; export type GetProjectThreadsQueryVariables = Exact<{ @@ -119,12 +112,8 @@ export type GetProjectThreadsQuery = ( { __typename?: 'ThreadObject' } & Pick & { userMessages: Array<( - { __typename?: 'UserMessageObject' } - & Pick - & { attachment: ( - { __typename?: 'FileOutput' } - & Pick - ) } + { __typename?: 'UserMessage' } + & Pick )> } )> } ); @@ -140,12 +129,8 @@ export type GetThreadByIdQuery = ( { __typename?: 'ThreadObject' } & Pick & { userMessages: Array<( - { __typename?: 'UserMessageObject' } - & Pick - & { attachment: ( - { __typename?: 'FileOutput' } - & Pick - ) } + { __typename?: 'UserMessage' } + & Pick )> } ) } ); @@ -158,12 +143,8 @@ export type MessagesQueryVariables = Exact<{ export type MessagesQuery = ( { __typename?: 'QueryRoot' } & { messages: Array<( - { __typename?: 'UserMessageObject' } - & Pick - & { attachment: ( - { __typename?: 'FileOutput' } - & Pick - ) } + { __typename?: 'UserMessage' } + & Pick )> } ); @@ -182,8 +163,7 @@ export type CreateThreadMutation = ( export type SendMsgMutationVariables = Exact<{ threadId: Scalars['String']; username: Scalars['String']; - msg?: Maybe; - file?: Maybe; + msg: Scalars['String']; }>; @@ -205,10 +185,6 @@ export type ConnectStreamSubscription = ( & { userMessage?: Maybe<( { __typename?: 'UserMessageObject' } & Pick - & { attachment: ( - { __typename?: 'FileOutput' } - & Pick - ) } )> } ) } );