Skip to content

Commit

Permalink
[E4E-30]:ApolloClient<object>
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCleric committed Nov 21, 2021
1 parent 6bce871 commit ae6db2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/useRestQuery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ export function wrapRestQuery<TName extends string>() {

export function useRestClientQuery<TName extends string, TData, TVariables>(
options: IEndpointOptions<NamedGQLResult<TName, TData>, TVariables | Input<TVariables>> &
// eslint-disable-next-line @typescript-eslint/no-explicit-any
QueryOptions<TVariables, NamedGQLResult<TName, TData>> & { client: ApolloClient<any> },
QueryOptions<TVariables, NamedGQLResult<TName, TData>> & { client: ApolloClient<object> },
): Promise<ApolloQueryResult<NamedGQLResult<TName, TData>>> {
validateQueryAgainstEndpoint(options.query, options.endpoint);
const directives = (options.query.definitions[0] as OperationDefinitionNode).selectionSet.selections[0].directives as DirectiveNode[];
Expand Down Expand Up @@ -222,11 +221,11 @@ export function useRestClientQuery<TName extends string, TData, TVariables>(
export function wrapRestClientQuery<TName extends string>() {
return <TData, TVariables>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: IEndpointOptions<TData, TVariables> & QueryOptions<TVariables, TData> & { client: ApolloClient<any> },
options: IEndpointOptions<TData, TVariables> & QueryOptions<TVariables, TData> & { client: ApolloClient<object> },
): Promise<ApolloQueryResult<NamedGQLResult<TName, TData>>> =>
useRestClientQuery(
options as unknown as IEndpointOptions<NamedGQLResult<TName, TData>, TVariables | Input<TVariables>> &
// eslint-disable-next-line @typescript-eslint/no-explicit-any
QueryOptions<TVariables, NamedGQLResult<TName, TData>> & { client: ApolloClient<any> },
QueryOptions<TVariables, NamedGQLResult<TName, TData>> & { client: ApolloClient<object> },
);
}

0 comments on commit ae6db2a

Please sign in to comment.