v3.7.6
Patch Changes
- #10470
47435e879
Thanks @alessbell! - Bumps TypeScript to4.9.4
(previously4.7.4
) and updates types to account for changes in TypeScript 4.8 by propagating contstraints on generic types. Technically this makes some types stricter as attempting to passnull|undefined
into certain functions is now disallowed by TypeScript, but these were never expected runtime values in the first place.
This should only affect you if you are wrapping functions provided by Apollo Client with your own abstractions that pass in their generics as type arguments, in which case you might get an error likeerror TS2344: Type 'YourGenericType' does not satisfy the constraint 'OperationVariables'
. In that case, make sure thatYourGenericType
is restricted to a type that only accepts objects viaextends
, likeRecord<string, any>
or@apollo/client
'sOperationVariables
:
import {
QueryHookOptions,
QueryResult,
useQuery,
+ OperationVariables,
} from '@apollo/client';
- export function useWrappedQuery<T, TVariables>(
+ export function useWrappedQuery<T, TVariables extends OperationVariables>(
query: DocumentNode,
queryOptions: QueryHookOptions<T, TVariables>
): QueryResult<T, TVariables> {
const [execute, result] = useQuery<T, TVariables>(query);
}
-
#10408
55ffafc58
Thanks @zlrlo! - fix: modify BatchHttpLink to have a separate timer for each different batch key -
#9573
4a4f48dda
Thanks @vladar! - Improve performance of local resolvers by only executing selection sets that contain an@client
directive. Previously, local resolvers were executed even when the field did not contain@client
. While the result was properly discarded, the unncessary work could negatively affect query performance, sometimes signficantly.