UNPKG

@apollo/client

Version:

A fully-featured caching GraphQL client.

24 lines 1.26 kB
import type { ApolloClient, TypeOverrides } from "@apollo/client"; /** * Signature style used for `ApolloClient` methods and hooks. * Classic signatures are method signatures in place until 4.1. * Modern signatures are the method signatures introduced in 4.1, * which are more accurate and take global `defaultOptions` into account. * Modern signatures require type inference and don't allow manually specified * generic arguments. Users need to opt into them, either by explicitly declaring * their signature style or by using `defaultOptions`. */ export type SignatureStyle = TypeOverrides extends ({ signatureStyle: infer S extends "modern" | "classic"; }) ? S : ApolloClient.Options extends { defaultOptions: {}; } ? "modern" : "classic"; /** * A type to disable "classic" signatures when "modern" signatures are in use. * Modern signatures are always active, as they are more complete than classic * signatures, but they are defined after the classic signatures, so while * classic signatures are active, TypeScript will not reach the modern signatures * as long as a classic signature can be satisfied. */ export type ClassicSignature = SignatureStyle extends "classic" ? unknown : never; //# sourceMappingURL=SignatureStyle.d.ts.map