@aws-amplify/api-graphql 4.6.7-graphql-multi-client.4f8e7a9.0 → 4.6.7-graphql-multi-client.ba4c61d.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,4 +9,4 @@ import { ClientGenerationParams } from './types';
9
9
  * @param params
10
10
  * @returns
11
11
  */
12
- export declare function generateClient<T extends Record<any, any> = never, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false>(params: ClientGenerationParams<WithCustomEndpoint, WithApiKey>): V6Client<T, WithCustomEndpoint, WithApiKey>;
12
+ export declare function generateClient<T extends Record<any, any> = never, Options extends ClientGenerationParams = ClientGenerationParams>(params: Options): V6Client<T, Options>;
@@ -1,4 +1,4 @@
1
1
  export { InternalGraphQLAPI, InternalGraphQLAPIClass, } from './InternalGraphQLAPI';
2
2
  export { graphql, cancel, isCancelError } from './v6';
3
3
  export { generateClient } from './generateClient';
4
- export { CommonPublicClientOptions } from './types';
4
+ export { CommonPublicClientOptions, DefaultCommonClientOptions } from './types';
@@ -10,4 +10,4 @@ import { CommonPublicClientOptions, ServerClientGenerationParams, V6ClientSSRCoo
10
10
  * @param params
11
11
  * @returns
12
12
  */
13
- export declare function generateClientWithAmplifyInstance<T extends Record<any, any> = never, ClientType extends V6ClientSSRRequest<T, any, any> | V6ClientSSRCookies<T, any, any> = V6ClientSSRCookies<T, any, any>>(params: ServerClientGenerationParams & CommonPublicClientOptions<any, any>): ClientType;
13
+ export declare function generateClientWithAmplifyInstance<T extends Record<any, any> = never, ClientType extends V6ClientSSRRequest<T> | V6ClientSSRCookies<T> = V6ClientSSRCookies<T>>(params: ServerClientGenerationParams & CommonPublicClientOptions): ClientType;
@@ -6,13 +6,20 @@ import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
6
6
  *
7
7
  * The knobs available for configuring `generateClient` internally.
8
8
  */
9
- export type ClientGenerationParams<WithCustomEndpoint extends boolean, WithApiKey extends boolean> = {
9
+ export type ClientGenerationParams = {
10
10
  amplify: AmplifyClassV6;
11
- } & CommonPublicClientOptions<WithCustomEndpoint, WithApiKey>;
11
+ } & CommonPublicClientOptions;
12
+ export interface DefaultCommonClientOptions {
13
+ endpoint?: never;
14
+ authMode?: GraphQLAuthMode;
15
+ apiKey?: string;
16
+ authToken?: string;
17
+ headers?: CustomHeaders;
18
+ }
12
19
  /**
13
20
  * Common options that can be used on public `generateClient()` interfaces.
14
21
  */
15
- export type CommonPublicClientOptions<WithCustomEndpoint extends boolean, WithApiKey extends boolean> = WithCustomEndpoint extends true ? WithApiKey extends true ? {
22
+ export type CommonPublicClientOptions = DefaultCommonClientOptions | {
16
23
  endpoint: string;
17
24
  authMode: 'apiKey';
18
25
  apiKey: string;
@@ -20,19 +27,8 @@ export type CommonPublicClientOptions<WithCustomEndpoint extends boolean, WithAp
20
27
  headers?: CustomHeaders;
21
28
  } | {
22
29
  endpoint: string;
23
- apiKey: string;
24
30
  authMode: Exclude<GraphQLAuthMode, 'apiKey'>;
25
- authToken?: string;
26
- headers?: CustomHeaders;
27
- } : {
28
- endpoint: string;
29
- authMode: Exclude<GraphQLAuthMode, 'apiKey'>;
30
- apiKey?: never;
31
- authToken?: string;
32
- headers?: CustomHeaders;
33
- } : {
34
- endpoint?: never;
35
- authMode?: GraphQLAuthMode;
31
+ apiKey?: string;
36
32
  authToken?: string;
37
33
  headers?: CustomHeaders;
38
34
  };
@@ -1,5 +1,5 @@
1
1
  import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
2
- import { GraphQLOptionsV6, GraphQLResponseV6, V6Client } from '../types';
2
+ import { CommonPublicClientOptions, GraphQLOptionsV6, GraphQLResponseV6, V6Client } from '../types';
3
3
  /**
4
4
  * Invokes graphql operations against a graphql service, providing correct input and
5
5
  * output types if Amplify-generated graphql from a recent version of the CLI/codegen
@@ -84,7 +84,7 @@ import { GraphQLOptionsV6, GraphQLResponseV6, V6Client } from '../types';
84
84
  * @param options
85
85
  * @param additionalHeaders
86
86
  */
87
- export declare function graphql<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(this: V6Client, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: CustomHeaders): GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
87
+ export declare function graphql<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string, Options extends CommonPublicClientOptions = object>(this: V6Client, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>, additionalHeaders?: CustomHeaders): GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
88
88
  /**
89
89
  * Cancels an inflight request. Only applicable for graphql queries and mutations
90
90
  * @param {any} request - request to cancel
@@ -1,3 +1,4 @@
1
+ import { ResourcesConfig } from '@aws-amplify/core';
1
2
  import { GenerateServerClientParams, V6ClientSSRRequest } from '../types';
2
3
  /**
3
4
  * Generates an GraphQL API client that works with Amplify server context.
@@ -15,4 +16,6 @@ import { GenerateServerClientParams, V6ClientSSRRequest } from '../types';
15
16
  * }),
16
17
  * });
17
18
  */
18
- export declare function generateClient<T extends Record<any, any> = never, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false>(options: GenerateServerClientParams<WithCustomEndpoint, WithApiKey>): V6ClientSSRRequest<T, WithCustomEndpoint, WithApiKey>;
19
+ export declare function generateClient<T extends Record<any, any> = never, Options extends GenerateServerClientParams = {
20
+ config: ResourcesConfig;
21
+ }>(options: Options): V6ClientSSRRequest<T, Options>;
@@ -165,7 +165,7 @@ export type GraphQLOperation = Source | string;
165
165
  * API V6 `graphql({options})` type that can leverage branded graphql `query`
166
166
  * objects and fallback types.
167
167
  */
168
- export type GraphQLOptionsV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false> = WithCustomEndpoint extends true ? WithApiKey extends true ? {
168
+ export type GraphQLOptionsV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string, Options extends CommonPublicClientOptions = object> = Options['endpoint'] extends string ? Options['apiKey'] extends string ? {
169
169
  query: TYPED_GQL_STRING | DocumentNode;
170
170
  variables?: GraphQLVariablesV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
171
171
  authMode?: GraphQLAuthMode;
@@ -324,23 +324,23 @@ export declare const __headers: unique symbol;
324
324
  export declare const __endpoint: unique symbol;
325
325
  export declare function getInternals(client: BaseClient): ClientInternals;
326
326
  export type ClientWithModels = V6Client | V6ClientSSRRequest | V6ClientSSRCookies;
327
- export type V6Client<T extends Record<any, any> = never, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false> = {
328
- graphql: GraphQLMethod<WithCustomEndpoint, WithApiKey>;
327
+ export type V6Client<T extends Record<any, any> = never, Options extends CommonPublicClientOptions = object> = {
328
+ graphql: GraphQLMethod<Options>;
329
329
  cancel(promise: Promise<any>, message?: string): boolean;
330
330
  isCancelError(error: any): boolean;
331
331
  } & ClientExtensions<T>;
332
- export type V6ClientSSRRequest<T extends Record<any, any> = never, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false> = {
333
- graphql: GraphQLMethodSSR<WithCustomEndpoint, WithApiKey>;
332
+ export type V6ClientSSRRequest<T extends Record<any, any> = never, Options extends CommonPublicClientOptions = object> = {
333
+ graphql: GraphQLMethodSSR<Options>;
334
334
  cancel(promise: Promise<any>, message?: string): boolean;
335
335
  isCancelError(error: any): boolean;
336
336
  } & ClientExtensionsSSRRequest<T>;
337
- export type V6ClientSSRCookies<T extends Record<any, any> = never, WithCustomEndpoint extends boolean = false, WithApiKey extends boolean = false> = {
338
- graphql: GraphQLMethod<WithCustomEndpoint, WithApiKey>;
337
+ export type V6ClientSSRCookies<T extends Record<any, any> = never, Options extends CommonPublicClientOptions = object> = {
338
+ graphql: GraphQLMethod<Options>;
339
339
  cancel(promise: Promise<any>, message?: string): boolean;
340
340
  isCancelError(error: any): boolean;
341
341
  } & ClientExtensionsSSRCookies<T>;
342
- export type GraphQLMethod<WithCustomEndpoint extends boolean, WithApiKey extends boolean> = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, WithCustomEndpoint, WithApiKey>, additionalHeaders?: CustomHeaders | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
343
- export type GraphQLMethodSSR<WithCustomEndpoint extends boolean, WithApiKey extends boolean> = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(contextSpec: AmplifyServer.ContextSpec, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, WithCustomEndpoint, WithApiKey>, additionalHeaders?: CustomHeaders | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
342
+ export type GraphQLMethod<Options extends CommonPublicClientOptions> = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>, additionalHeaders?: CustomHeaders | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
343
+ export type GraphQLMethodSSR<Options extends CommonPublicClientOptions> = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(contextSpec: AmplifyServer.ContextSpec, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>, additionalHeaders?: CustomHeaders | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
344
344
  /**
345
345
  * @private
346
346
  *
@@ -361,6 +361,6 @@ export interface AuthModeParams extends Record<string, unknown> {
361
361
  authMode?: GraphQLAuthMode;
362
362
  authToken?: string;
363
363
  }
364
- export type GenerateServerClientParams<WithCustomEndpoint extends boolean, WithApiKey extends boolean> = {
364
+ export type GenerateServerClientParams = {
365
365
  config: ResourcesConfig;
366
- } & CommonPublicClientOptions<WithCustomEndpoint, WithApiKey>;
366
+ } & CommonPublicClientOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/api-graphql",
3
- "version": "4.6.7-graphql-multi-client.4f8e7a9.0+4f8e7a9",
3
+ "version": "4.6.7-graphql-multi-client.ba4c61d.0+ba4c61d",
4
4
  "description": "Api-graphql category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -84,8 +84,8 @@
84
84
  "server"
85
85
  ],
86
86
  "dependencies": {
87
- "@aws-amplify/api-rest": "4.0.64-graphql-multi-client.4f8e7a9.0+4f8e7a9",
88
- "@aws-amplify/core": "6.7.4-graphql-multi-client.4f8e7a9.0+4f8e7a9",
87
+ "@aws-amplify/api-rest": "4.0.64-graphql-multi-client.ba4c61d.0+ba4c61d",
88
+ "@aws-amplify/core": "6.7.4-graphql-multi-client.ba4c61d.0+ba4c61d",
89
89
  "@aws-amplify/data-schema": "^1.7.0",
90
90
  "@aws-sdk/types": "3.387.0",
91
91
  "graphql": "15.8.0",
@@ -101,5 +101,5 @@
101
101
  "limit": "91.7 kB"
102
102
  }
103
103
  ],
104
- "gitHead": "4f8e7a94a1c2540baa7eda530787b248b0fb237a"
104
+ "gitHead": "ba4c61dd1dd3014c8f3dfc1ebfc66bcf8170eaa9"
105
105
  }
@@ -37,11 +37,8 @@ import { ClientGenerationParams } from './types';
37
37
  */
38
38
  export function generateClient<
39
39
  T extends Record<any, any> = never,
40
- WithCustomEndpoint extends boolean = false,
41
- WithApiKey extends boolean = false,
42
- >(
43
- params: ClientGenerationParams<WithCustomEndpoint, WithApiKey>,
44
- ): V6Client<T, WithCustomEndpoint, WithApiKey> {
40
+ Options extends ClientGenerationParams = ClientGenerationParams,
41
+ >(params: Options): V6Client<T, Options> {
45
42
  const client = {
46
43
  [__amplify]: params.amplify,
47
44
  [__authMode]: params.authMode,
@@ -7,4 +7,4 @@ export {
7
7
 
8
8
  export { graphql, cancel, isCancelError } from './v6';
9
9
  export { generateClient } from './generateClient';
10
- export { CommonPublicClientOptions } from './types';
10
+ export { CommonPublicClientOptions, DefaultCommonClientOptions } from './types';
@@ -33,10 +33,10 @@ import { cancel, graphql, isCancelError } from '..';
33
33
  export function generateClientWithAmplifyInstance<
34
34
  T extends Record<any, any> = never,
35
35
  ClientType extends
36
- | V6ClientSSRRequest<T, any, any>
37
- | V6ClientSSRCookies<T, any, any> = V6ClientSSRCookies<T, any, any>,
36
+ | V6ClientSSRRequest<T>
37
+ | V6ClientSSRCookies<T> = V6ClientSSRCookies<T>,
38
38
  >(
39
- params: ServerClientGenerationParams & CommonPublicClientOptions<any, any>,
39
+ params: ServerClientGenerationParams & CommonPublicClientOptions,
40
40
  ): ClientType {
41
41
  const client = {
42
42
  [__amplify]: params.amplify,
@@ -9,46 +9,34 @@ import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
9
9
  *
10
10
  * The knobs available for configuring `generateClient` internally.
11
11
  */
12
- export type ClientGenerationParams<
13
- WithCustomEndpoint extends boolean,
14
- WithApiKey extends boolean,
15
- > = {
12
+ export type ClientGenerationParams = {
16
13
  amplify: AmplifyClassV6;
17
- } & CommonPublicClientOptions<WithCustomEndpoint, WithApiKey>;
14
+ } & CommonPublicClientOptions;
15
+
16
+ export interface DefaultCommonClientOptions {
17
+ endpoint?: never;
18
+ authMode?: GraphQLAuthMode;
19
+ apiKey?: string;
20
+ authToken?: string;
21
+ headers?: CustomHeaders;
22
+ }
18
23
 
19
24
  /**
20
25
  * Common options that can be used on public `generateClient()` interfaces.
21
26
  */
22
- export type CommonPublicClientOptions<
23
- WithCustomEndpoint extends boolean,
24
- WithApiKey extends boolean,
25
- > = WithCustomEndpoint extends true
26
- ? WithApiKey extends true
27
- ?
28
- | {
29
- endpoint: string;
30
- authMode: 'apiKey';
31
- apiKey: string;
32
- authToken?: string;
33
- headers?: CustomHeaders;
34
- }
35
- | {
36
- endpoint: string;
37
- apiKey: string;
38
- authMode: Exclude<GraphQLAuthMode, 'apiKey'>;
39
- authToken?: string;
40
- headers?: CustomHeaders;
41
- }
42
- : {
43
- endpoint: string;
44
- authMode: Exclude<GraphQLAuthMode, 'apiKey'>;
45
- apiKey?: never;
46
- authToken?: string;
47
- headers?: CustomHeaders;
48
- }
49
- : {
50
- endpoint?: never;
51
- authMode?: GraphQLAuthMode;
27
+ export type CommonPublicClientOptions =
28
+ | DefaultCommonClientOptions
29
+ | {
30
+ endpoint: string;
31
+ authMode: 'apiKey';
32
+ apiKey: string;
33
+ authToken?: string;
34
+ headers?: CustomHeaders;
35
+ }
36
+ | {
37
+ endpoint: string;
38
+ authMode: Exclude<GraphQLAuthMode, 'apiKey'>;
39
+ apiKey?: string;
52
40
  authToken?: string;
53
41
  headers?: CustomHeaders;
54
- };
42
+ };
@@ -4,6 +4,7 @@ import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
4
4
 
5
5
  import { GraphQLAPI } from '../GraphQLAPI';
6
6
  import {
7
+ CommonPublicClientOptions,
7
8
  GraphQLOptionsV6,
8
9
  GraphQLResponseV6,
9
10
  V6Client,
@@ -97,9 +98,10 @@ import {
97
98
  export function graphql<
98
99
  FALLBACK_TYPES = unknown,
99
100
  TYPED_GQL_STRING extends string = string,
101
+ Options extends CommonPublicClientOptions = object,
100
102
  >(
101
103
  this: V6Client,
102
- options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>,
104
+ options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>,
103
105
  additionalHeaders?: CustomHeaders,
104
106
  ): GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING> {
105
107
  // inject client-level auth
@@ -154,7 +156,7 @@ export function graphql<
154
156
  {
155
157
  ...options,
156
158
  endpoint: clientEndpoint,
157
- },
159
+ } as any,
158
160
  headers,
159
161
  );
160
162
 
@@ -5,6 +5,7 @@ import {
5
5
  AmplifyServer,
6
6
  getAmplifyServerContext,
7
7
  } from '@aws-amplify/core/internals/adapter-core';
8
+ import { ResourcesConfig } from '@aws-amplify/core';
8
9
  import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
9
10
 
10
11
  import { generateClientWithAmplifyInstance } from '../internals/server';
@@ -35,26 +36,17 @@ import {
35
36
  */
36
37
  export function generateClient<
37
38
  T extends Record<any, any> = never,
38
- WithCustomEndpoint extends boolean = false,
39
- WithApiKey extends boolean = false,
40
- >(
41
- options: GenerateServerClientParams<WithCustomEndpoint, WithApiKey>,
42
- ): V6ClientSSRRequest<T, WithCustomEndpoint, WithApiKey> {
39
+ Options extends GenerateServerClientParams = { config: ResourcesConfig },
40
+ >(options: Options): V6ClientSSRRequest<T, Options> {
43
41
  // passing `null` instance because each (future model) method must retrieve a valid instance
44
42
  // from server context
45
- const client = generateClientWithAmplifyInstance<
46
- T,
47
- V6ClientSSRRequest<T, any, any>
48
- >({
43
+ const client = generateClientWithAmplifyInstance<T, V6ClientSSRRequest<T>>({
49
44
  amplify: null,
50
45
  ...options,
51
46
  });
52
47
 
53
48
  // TODO: improve this and the next type
54
- const prevGraphql = client.graphql as unknown as GraphQLMethod<
55
- WithCustomEndpoint,
56
- WithApiKey
57
- >;
49
+ const prevGraphql = client.graphql as unknown as GraphQLMethod<Options>;
58
50
 
59
51
  const wrappedGraphql = (
60
52
  contextSpec: AmplifyServer.ContextSpec,
@@ -70,10 +62,7 @@ export function generateClient<
70
62
  );
71
63
  };
72
64
 
73
- client.graphql = wrappedGraphql as unknown as GraphQLMethodSSR<
74
- WithCustomEndpoint,
75
- WithApiKey
76
- >;
65
+ client.graphql = wrappedGraphql as unknown as GraphQLMethodSSR<Options>;
77
66
 
78
67
  return client;
79
68
  }
@@ -216,10 +216,9 @@ export type GraphQLOperation = Source | string;
216
216
  export type GraphQLOptionsV6<
217
217
  FALLBACK_TYPES = unknown,
218
218
  TYPED_GQL_STRING extends string = string,
219
- WithCustomEndpoint extends boolean = false,
220
- WithApiKey extends boolean = false, // i.e., The client already has apiKey configured.
221
- > = WithCustomEndpoint extends true
222
- ? WithApiKey extends true
219
+ Options extends CommonPublicClientOptions = object,
220
+ > = Options['endpoint'] extends string
221
+ ? Options['apiKey'] extends string
223
222
  ? {
224
223
  query: TYPED_GQL_STRING | DocumentNode;
225
224
  variables?: GraphQLVariablesV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
@@ -447,58 +446,45 @@ export type ClientWithModels =
447
446
 
448
447
  export type V6Client<
449
448
  T extends Record<any, any> = never,
450
- WithCustomEndpoint extends boolean = false,
451
- WithApiKey extends boolean = false,
449
+ Options extends CommonPublicClientOptions = object,
452
450
  > = {
453
- graphql: GraphQLMethod<WithCustomEndpoint, WithApiKey>;
451
+ graphql: GraphQLMethod<Options>;
454
452
  cancel(promise: Promise<any>, message?: string): boolean;
455
453
  isCancelError(error: any): boolean;
456
454
  } & ClientExtensions<T>;
457
455
 
458
456
  export type V6ClientSSRRequest<
459
457
  T extends Record<any, any> = never,
460
- WithCustomEndpoint extends boolean = false,
461
- WithApiKey extends boolean = false,
458
+ Options extends CommonPublicClientOptions = object,
462
459
  > = {
463
- graphql: GraphQLMethodSSR<WithCustomEndpoint, WithApiKey>;
460
+ graphql: GraphQLMethodSSR<Options>;
464
461
  cancel(promise: Promise<any>, message?: string): boolean;
465
462
  isCancelError(error: any): boolean;
466
463
  } & ClientExtensionsSSRRequest<T>;
467
464
 
468
465
  export type V6ClientSSRCookies<
469
466
  T extends Record<any, any> = never,
470
- WithCustomEndpoint extends boolean = false,
471
- WithApiKey extends boolean = false,
467
+ Options extends CommonPublicClientOptions = object,
472
468
  > = {
473
- graphql: GraphQLMethod<WithCustomEndpoint, WithApiKey>;
469
+ graphql: GraphQLMethod<Options>;
474
470
  cancel(promise: Promise<any>, message?: string): boolean;
475
471
  isCancelError(error: any): boolean;
476
472
  } & ClientExtensionsSSRCookies<T>;
477
473
 
478
- export type GraphQLMethod<
479
- WithCustomEndpoint extends boolean,
480
- WithApiKey extends boolean,
481
- > = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(
482
- options: GraphQLOptionsV6<
483
- FALLBACK_TYPES,
484
- TYPED_GQL_STRING,
485
- WithCustomEndpoint,
486
- WithApiKey
487
- >,
474
+ export type GraphQLMethod<Options extends CommonPublicClientOptions> = <
475
+ FALLBACK_TYPES = unknown,
476
+ TYPED_GQL_STRING extends string = string,
477
+ >(
478
+ options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>,
488
479
  additionalHeaders?: CustomHeaders | undefined,
489
480
  ) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
490
481
 
491
- export type GraphQLMethodSSR<
492
- WithCustomEndpoint extends boolean,
493
- WithApiKey extends boolean,
494
- > = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(
482
+ export type GraphQLMethodSSR<Options extends CommonPublicClientOptions> = <
483
+ FALLBACK_TYPES = unknown,
484
+ TYPED_GQL_STRING extends string = string,
485
+ >(
495
486
  contextSpec: AmplifyServer.ContextSpec,
496
- options: GraphQLOptionsV6<
497
- FALLBACK_TYPES,
498
- TYPED_GQL_STRING,
499
- WithCustomEndpoint,
500
- WithApiKey
501
- >,
487
+ options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING, Options>,
502
488
  additionalHeaders?: CustomHeaders | undefined,
503
489
  ) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
504
490
 
@@ -530,9 +516,6 @@ export interface AuthModeParams extends Record<string, unknown> {
530
516
  authToken?: string;
531
517
  }
532
518
 
533
- export type GenerateServerClientParams<
534
- WithCustomEndpoint extends boolean,
535
- WithApiKey extends boolean,
536
- > = {
519
+ export type GenerateServerClientParams = {
537
520
  config: ResourcesConfig;
538
- } & CommonPublicClientOptions<WithCustomEndpoint, WithApiKey>;
521
+ } & CommonPublicClientOptions;