apollo-feature-requests
apollo-feature-requests copied to clipboard
More Specific Context Types
The context type specified for context is almost always either any or Record<string,any>. Asking for an optional generic to help enforce context shapes. Below find an example from ApolloClient.query. Propose to change these interfaces to use an optional generic parameter:
export interface QueryOptions<TVariables = OperationVariables, TData = any> {
...
context?: any;
...
}
export interface QueryOptions<TVariables = OperationVariables, TData = any, TContext = any> {
...
context?: TContext;
...
}