77import { ApolloLink } from ' @apollo/client/link' ;
88import type { ASTNode } from ' graphql' ;
99import { ClientAwarenessLink } from ' @apollo/client/link/client-awareness' ;
10- import type { print as print_2 } from ' @apollo/client/utilities ' ;
10+ import type { print as print_2 } from ' graphql ' ;
1111
1212// @public (undocumented)
13+ export namespace BaseHttpLink {
14+ // (undocumented)
15+ export interface Body {
16+ // (undocumented)
17+ extensions? : Record <string , any >;
18+ // (undocumented)
19+ operationName? : string ;
20+ // (undocumented)
21+ query? : string ;
22+ // (undocumented)
23+ variables? : Record <string , any >;
24+ }
25+ export interface ContextOptions {
26+ credentials? : RequestCredentials ;
27+ fetchOptions? : RequestInit ;
28+ headers? : Record <string , string >;
29+ http? : BaseHttpLink .HttpOptions ;
30+ uri? : string | BaseHttpLink .UriFunction ;
31+ }
32+ export interface HttpOptions {
33+ accept? : string [];
34+ includeExtensions? : boolean ;
35+ includeQuery? : boolean ;
36+ preserveHeaderCase? : boolean ;
37+ }
38+ export interface Options extends Shared .Options {
39+ useGETForQueries? : boolean ;
40+ }
41+ // (undocumented)
42+ export type Printer = (node : ASTNode , originalPrint : typeof print_2 ) => string ;
43+ // (undocumented)
44+ export namespace Shared {
45+ export interface Options {
46+ credentials? : RequestCredentials ;
47+ fetch? : typeof fetch ;
48+ fetchOptions? : RequestInit ;
49+ headers? : Record <string , string >;
50+ includeExtensions? : boolean ;
51+ includeUnusedVariables? : boolean ;
52+ preserveHeaderCase? : boolean ;
53+ print? : BaseHttpLink .Printer ;
54+ uri? : string | BaseHttpLink .UriFunction ;
55+ }
56+ }
57+ // (undocumented)
58+ export type UriFunction = (operation : ApolloLink .Operation ) => string ;
59+ }
60+
61+ // @public
1362export class BaseHttpLink extends ApolloLink {
14- constructor (linkOptions ? : HttpLink .Options );
63+ constructor (options ? : BaseHttpLink .Options );
1564}
1665
1766// @public (undocumented)
1867export const checkFetcher: (fetcher : typeof fetch | undefined ) => void ;
1968
2069// @public @deprecated (undocumented)
21- export const createHttpLink: (linkOptions ? : HttpLink . Options & ClientAwarenessLink .Options ) => HttpLink ;
70+ export const createHttpLink: (options ? : HttpLink .Options ) => HttpLink ;
2271
2372// @public @deprecated (undocumented)
2473export const createSignalIfSupported: () => {
@@ -30,11 +79,11 @@ export const createSignalIfSupported: () => {
3079};
3180
3281// @public (undocumented)
33- export const defaultPrinter: HttpLink .Printer ;
82+ export const defaultPrinter: BaseHttpLink .Printer ;
3483
3584// @public (undocumented)
3685export const fallbackHttpConfig: {
37- http: HttpLink .HttpOptions ;
86+ http: BaseHttpLink .HttpOptions ;
3887 headers: {
3988 accept: string ;
4089 " content-type" : string ;
@@ -51,70 +100,29 @@ interface HttpConfig {
51100 // (undocumented)
52101 headers? : Record <string , string >;
53102 // (undocumented)
54- http? : HttpLink .HttpOptions ;
103+ http? : BaseHttpLink .HttpOptions ;
55104 // (undocumented)
56105 options? : any ;
57106}
58107
59108// @public (undocumented)
60109export namespace HttpLink {
61- // (undocumented)
62- export interface Body {
63- // (undocumented)
64- extensions? : Record <string , any >;
65- // (undocumented)
66- operationName? : string ;
67- // (undocumented)
68- query? : string ;
69- // (undocumented)
70- variables? : Record <string , any >;
110+ export interface ContextOptions extends BaseHttpLink .ContextOptions , ClientAwarenessLink .ContextOptions {
71111 }
72- export interface ContextOptions {
73- credentials? : RequestCredentials ;
74- fetchOptions? : RequestInit ;
75- headers? : Record <string , string >;
76- http? : HttpLink .HttpOptions ;
77- uri? : string | HttpLink .UriFunction ;
112+ export interface Options extends BaseHttpLink .Options , ClientAwarenessLink .Options {
78113 }
79- export interface HttpOptions {
80- accept? : string [];
81- includeExtensions? : boolean ;
82- includeQuery? : boolean ;
83- preserveHeaderCase? : boolean ;
84- }
85- export interface Options extends Shared .Options {
86- useGETForQueries? : boolean ;
87- }
88- // (undocumented)
89- export type Printer = (node : ASTNode , originalPrint : typeof print_2 ) => string ;
90- // (undocumented)
91- export namespace Shared {
92- export interface Options {
93- credentials? : RequestCredentials ;
94- fetch? : typeof fetch ;
95- fetchOptions? : RequestInit ;
96- headers? : Record <string , string >;
97- includeExtensions? : boolean ;
98- includeUnusedVariables? : boolean ;
99- preserveHeaderCase? : boolean ;
100- print? : HttpLink .Printer ;
101- uri? : string | HttpLink .UriFunction ;
102- }
103- }
104- // (undocumented)
105- export type UriFunction = (operation : ApolloLink .Operation ) => string ;
106114}
107115
108116// @public
109117export class HttpLink extends ApolloLink {
110- constructor (options ? : HttpLink .Options & ClientAwarenessLink . Options );
118+ constructor (options ? : HttpLink .Options );
111119}
112120
113121// @public (undocumented)
114122export function parseAndCheckHttpResponse(operations : ApolloLink .Operation | ApolloLink .Operation []): (response : Response ) => Promise <any >;
115123
116124// @public (undocumented)
117- export function rewriteURIForGET(chosenURI : string , body : HttpLink .Body ): {
125+ export function rewriteURIForGET(chosenURI : string , body : BaseHttpLink .Body ): {
118126 parseError: unknown ;
119127 newURI? : undefined ;
120128} | {
@@ -127,13 +135,13 @@ export function rewriteURIForGET(chosenURI: string, body: HttpLink.Body): {
127135// @public (undocumented)
128136export function selectHttpOptionsAndBody(operation : ApolloLink .Operation , fallbackConfig : HttpConfig , ... configs : Array <HttpConfig >): {
129137 options: HttpConfig & Record <string , any >;
130- body: HttpLink .Body ;
138+ body: BaseHttpLink .Body ;
131139};
132140
133141// @public (undocumented)
134- export function selectHttpOptionsAndBodyInternal(operation : ApolloLink .Operation , printer : HttpLink .Printer , ... configs : HttpConfig []): {
142+ export function selectHttpOptionsAndBodyInternal(operation : ApolloLink .Operation , printer : BaseHttpLink .Printer , ... configs : HttpConfig []): {
135143 options: HttpConfig & Record <string , any >;
136- body: HttpLink .Body ;
144+ body: BaseHttpLink .Body ;
137145};
138146
139147// @public (undocumented)
0 commit comments