@@ -103,13 +103,13 @@ export async function generateComposables(meta: GraphQLMeta): Promise<string> {
103103 template . push (
104104 `export const use${ capitalizeFirstLetter ( query ) } Query = (${
105105 types . argType ? 'variables: { ' + types . argType + ' },' : ''
106- } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<{data: ${ types . returnType } ; error: GraphqlError | null}> => gqlQuery<${ types . returnType } >('${ query } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , options})`,
106+ } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<{data: ${ types . returnType } ; error: GraphqlError | null}> => gqlQuery<${ types . returnType } >('${ query } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , ... options})`,
107107 ) ;
108108
109109 template . push (
110110 `export const useAsync${ capitalizeFirstLetter ( query ) } Query = (${
111111 types . argType ? 'variables: { ' + types . argType + ' },' : ''
112- } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<AsyncData<${ types . returnType } , Error>> => gqlAsyncQuery<${ types . returnType } >('${ query } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , options})`,
112+ } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<AsyncData<${ types . returnType } , Error>> => gqlAsyncQuery<${ types . returnType } >('${ query } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , ... options})`,
113113 ) ;
114114 }
115115 }
@@ -124,7 +124,7 @@ export async function generateComposables(meta: GraphQLMeta): Promise<string> {
124124 template . push (
125125 `export const use${ capitalizeFirstLetter ( mutation ) } Mutation = (${
126126 types . argType ? 'variables: { ' + types . argType + ' },' : ''
127- } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<{data: ${ types . returnType } ; error: GraphqlError}> => gqlMutation<${ types . returnType } >('${ mutation } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , options})`,
127+ } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<{data: ${ types . returnType } ; error: GraphqlError}> => gqlMutation<${ types . returnType } >('${ mutation } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , ... options})`,
128128 ) ;
129129 }
130130 }
@@ -139,7 +139,7 @@ export async function generateComposables(meta: GraphQLMeta): Promise<string> {
139139 template . push (
140140 `export const use${ capitalizeFirstLetter ( subscription ) } Subscription = (${
141141 types . argType ? 'variables: { ' + types . argType + ' },' : ''
142- } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<ReturnTypeOfSubscription<${ types . returnType } >> => gqlSubscription<${ types . returnType } >('${ subscription } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , options})`,
142+ } ${ returnTypeIsDefaultType ? '' : `fields?: InputFields<${ inputFieldsType } >[] | null,` } options?: IGraphQLOptions): Promise<ReturnTypeOfSubscription<${ types . returnType } >> => gqlSubscription<${ types . returnType } >('${ subscription } ', {${ types . argType ? 'variables,' : '' } ${ returnTypeIsDefaultType ? 'fields: null' : 'fields' } , ... options})`,
143143 ) ;
144144 }
145145 }
0 commit comments