You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow function as valid type for UrlSchemaOptions.customFetch (#10150)
* Add type CustomSchemaFetcher
* Add test for using function as customFetch
* Fix linting
* Add documentation
* Add changeset
* Update changeset to remove website as it is not a package
---------
Co-authored-by: Armin Wiebigke <armin.wiebigke@dlr.de>
Co-authored-by: Armin Wiebigke <armin.wiebigke@gmail.com>
Co-authored-by: Eddy Nguyen <ch@eddeee888.me>
Co-authored-by: Eddy Nguyen <github@eddeee888.me>
Allow functions to be passed as valid values for `UrlSchemaOptions.customFetch`. This was already possible, but the type definitions did not reflect that correctly.
* @description Loads a schema from remote endpoint, with custom http options.
@@ -85,9 +91,9 @@ export namespace Types {
85
91
*/
86
92
headers?: {[headerName: string]: string};
87
93
/**
88
-
* @description Specify a Node module name, or a custom file, to be used instead of standard `fetch`
94
+
* @description Specify a Node module name, a custom file, or a function, to be used instead of a standard `fetch`.
89
95
*/
90
-
customFetch?: string;
96
+
customFetch?: string|CustomSchemaFetcher;
91
97
/**
92
98
* @description HTTP Method to use, either POST (default) or GET.
93
99
*/
@@ -407,10 +413,9 @@ export namespace Types {
407
413
*/
408
414
require?: RequireExtension;
409
415
/**
410
-
* @description Name for a library that implements `fetch`.
411
-
* Use this to tell codegen to use that to fetch schemas in a custom way.
416
+
* @description Specify a Node module name, a custom file, or a function, to be used instead of a standard `fetch`.
412
417
*/
413
-
customFetch?: string;
418
+
customFetch?: string|CustomSchemaFetcher;
414
419
/**
415
420
* @description A pointer(s) to your GraphQL documents: query, mutation, subscription and fragment. These documents will be loaded into for all your output files.
0 commit comments