@hyper-fetch/graphql 6.0.1 โ†’ 7.0.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.
package/.eslintrc.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
- "extends": ["../../.eslintrc.json"],
2
+ "extends": ["plugin:@nx/react", "../../.eslintrc.js"],
3
3
  "parserOptions": {
4
- "project": ["./tsconfig.json", "./__tests__/tsconfig.json"]
5
- }
4
+ "project": ["./tsconfig.json"]
5
+ },
6
+ "rules": {
7
+ "react/jsx-props-no-spreading": 0,
8
+ "react/require-default-props": 0
9
+ },
10
+ "ignorePatterns": ["dist/", "coverage/", "jest.config.ts", "/*.js"]
6
11
  }
package/README.md CHANGED
@@ -44,17 +44,17 @@ Hyper Fetch for your GraphQL-powered projects.
44
44
 
45
45
  ๐Ÿš€ **Queueing** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/queueing)
46
46
 
47
- ๐Ÿ’Ž **Automatic caching** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/core/cache)
47
+ ๐Ÿ’Ž **Automatic caching** - [Read more](https://hyperfetch.bettertyped.com/docs/core/cache)
48
48
 
49
49
  ๐Ÿช„ **Persistence** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/persistence)
50
50
 
51
- ๐ŸŽŠ **SSR Support** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/environment)
51
+ ๐ŸŽŠ **SSR Support** - [Read more](https://hyperfetch.bettertyped.com/docs/getting-started/environment)
52
52
 
53
53
  ๐Ÿ”‹ **Offline First** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/advanced/offline)
54
54
 
55
- ๐Ÿ“ก **Built-in adapter** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/core/adapter)
55
+ ๐Ÿ“ก **Built-in adapter** - [Read more](https://hyperfetch.bettertyped.com/docs/core/adapter)
56
56
 
57
- ๐Ÿงช **Easy to test** - [Read more](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/testing)
57
+ ๐Ÿงช **Easy to test** - [Read more](https://hyperfetch.bettertyped.com/docs/getting-started/testing)
58
58
 
59
59
  ๐ŸŽŸ **Authentication** - [Read more](https://hyperfetch.bettertyped.com/docs/guides/basic/authentication)
60
60
 
@@ -66,7 +66,7 @@ Hyper Fetch for your GraphQL-powered projects.
66
66
 
67
67
  ## Sources
68
68
 
69
- - #### [Installation](https://hyperfetch.bettertyped.com/docs/documentation/getting-started/installation)
69
+ - #### [Installation](https://hyperfetch.bettertyped.com/docs/getting-started/installation)
70
70
  - #### [Docs](https://hyperfetch.bettertyped.com/)
71
71
  - #### [API](https://hyperfetch.bettertyped.com/api/)
72
72
  - #### [NPM](https://www.npmjs.com/package/@hyper-fetch/graphql)
@@ -0,0 +1,191 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+
22
+ // src/adapter/http-adapter.browser.ts
23
+ import {
24
+ getResponseHeaders,
25
+ parseResponse,
26
+ getErrorMessage,
27
+ Adapter,
28
+ stringifyKey
29
+ } from "@hyper-fetch/core";
30
+ var getGqlAdapter = () => new Adapter({
31
+ name: "graphql-browser",
32
+ defaultMethod: "POST" /* POST */,
33
+ defaultExtra: gqlExtra,
34
+ systemErrorStatus: 0,
35
+ systemErrorExtra: gqlExtra
36
+ }).onInitialize(({ client }) => {
37
+ client.setCacheKeyMapper((request) => {
38
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${stringifyKey(request.params)}-${stringifyKey(request.queryParams)}`;
39
+ });
40
+ client.setQueryKeyMapper((request) => {
41
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${stringifyKey(request.params)}-${stringifyKey(request.queryParams)}`;
42
+ });
43
+ client.setAbortKeyMapper((request) => {
44
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${request.cancelable}`;
45
+ });
46
+ }).setInternalErrorMapping((error) => [error]).setDevtoolsEndpointGetter(gqlEndpointNameMapper).setEndpointMapper(gqlEndpointMapper).setFetcher(
47
+ (_0) => __async(void 0, [_0], function* ({
48
+ request,
49
+ adapterOptions,
50
+ headers,
51
+ onError,
52
+ onResponseEnd,
53
+ onTimeoutError,
54
+ onRequestEnd,
55
+ createAbortListener,
56
+ onResponseProgress,
57
+ onRequestProgress,
58
+ onResponseStart,
59
+ onBeforeRequest,
60
+ onRequestStart,
61
+ onSuccess
62
+ }) {
63
+ const { fullUrl, payload } = getRequestValues(request);
64
+ const xhr = new XMLHttpRequest();
65
+ xhr.timeout = defaultTimeout;
66
+ const onAbort = () => xhr.abort();
67
+ if (adapterOptions) {
68
+ Object.entries(adapterOptions).forEach(([name, value]) => {
69
+ xhr[name] = value;
70
+ });
71
+ }
72
+ xhr.open(request.method, fullUrl, true);
73
+ Object.entries(headers).forEach(([name, value]) => xhr.setRequestHeader(name, value));
74
+ const unmountListener = createAbortListener({ status: 0, extra: gqlExtra, onAbort });
75
+ xhr.upload.onprogress = onRequestProgress;
76
+ xhr.onloadstart = () => {
77
+ onRequestEnd();
78
+ onResponseStart();
79
+ };
80
+ xhr.onprogress = onResponseProgress;
81
+ xhr.onloadend = () => {
82
+ onResponseEnd();
83
+ unmountListener();
84
+ };
85
+ xhr.ontimeout = () => onTimeoutError({ status: 0, extra: gqlExtra });
86
+ xhr.onreadystatechange = (e) => {
87
+ var _a;
88
+ const event = e;
89
+ const finishedState = 4;
90
+ if (event.target && event.target.readyState === finishedState) {
91
+ const { status } = event.target;
92
+ const response = parseResponse(event.target.response);
93
+ const data = (_a = response.data) != null ? _a : null;
94
+ const errors = (response == null ? void 0 : response.errors) || null;
95
+ const extensions = (response == null ? void 0 : response.extensions) || {};
96
+ const failure = (response == null ? void 0 : response.errors) || status > 399 || status === 0;
97
+ const responseHeaders = getResponseHeaders(xhr.getAllResponseHeaders());
98
+ if (failure) {
99
+ const error = errors || [getErrorMessage()];
100
+ onError({ error, status, extra: { headers: responseHeaders, extensions } });
101
+ } else {
102
+ onSuccess({
103
+ data,
104
+ error: errors,
105
+ status,
106
+ extra: { headers: responseHeaders, extensions }
107
+ });
108
+ }
109
+ }
110
+ };
111
+ onBeforeRequest();
112
+ onRequestStart();
113
+ xhr.send(payload);
114
+ })
115
+ );
116
+
117
+ // src/adapter/adapter.ts
118
+ var GraphqlAdapter = () => {
119
+ if (typeof XMLHttpRequest !== "undefined") {
120
+ return getGqlAdapter();
121
+ }
122
+ return getGqlAdapter();
123
+ };
124
+
125
+ // src/adapter/adapter.types.ts
126
+ var GraphqlMethod = /* @__PURE__ */ ((GraphqlMethod2) => {
127
+ GraphqlMethod2["POST"] = "POST";
128
+ GraphqlMethod2["GET"] = "GET";
129
+ return GraphqlMethod2;
130
+ })(GraphqlMethod || {});
131
+
132
+ // src/adapter/adapter.utils.ts
133
+ import { HttpMethods, stringifyQueryParams } from "@hyper-fetch/core";
134
+ import { print, parse } from "graphql";
135
+ var getRequestValues = (request) => {
136
+ const isPostRequest = request.method === HttpMethods.POST;
137
+ const query = request.endpoint;
138
+ const variables = request.payload;
139
+ const fullUrl = isPostRequest ? request.client.url : request.client.url + stringifyQueryParams({ query, variables });
140
+ const payload = isPostRequest ? JSON.stringify({
141
+ query,
142
+ variables
143
+ }) : null;
144
+ return { fullUrl, payload };
145
+ };
146
+ var gqlEndpointMapper = (endpoint) => {
147
+ if (typeof endpoint === "string") {
148
+ return endpoint;
149
+ }
150
+ return print(endpoint);
151
+ };
152
+ var gqlEndpointNameMapper = (endpoint) => {
153
+ var _a;
154
+ try {
155
+ const ast = parse(endpoint);
156
+ const operationDefinition = ast.definitions.find(
157
+ (def) => def.kind === "OperationDefinition"
158
+ );
159
+ if (operationDefinition) {
160
+ if ((_a = operationDefinition.name) == null ? void 0 : _a.value) {
161
+ return operationDefinition.name.value;
162
+ }
163
+ const selection = operationDefinition.selectionSet.selections[0];
164
+ if ((selection == null ? void 0 : selection.kind) === "Field") {
165
+ return selection.name.value;
166
+ }
167
+ }
168
+ } catch (error) {
169
+ }
170
+ const clearedQuery = endpoint.replace(/(query|mutation|subscription)/, "").replace(/[{}().,:]/g, " ").trim();
171
+ const [name] = clearedQuery.split(" ");
172
+ return name || "graphql-request";
173
+ };
174
+
175
+ // src/adapter/adapter.constants.ts
176
+ import { Time } from "@hyper-fetch/core";
177
+ var defaultTimeout = Time.SEC * 5;
178
+ var gqlExtra = {
179
+ headers: {},
180
+ extensions: {}
181
+ };
182
+ export {
183
+ GraphqlAdapter,
184
+ GraphqlMethod,
185
+ defaultTimeout,
186
+ getRequestValues,
187
+ gqlEndpointMapper,
188
+ gqlEndpointNameMapper,
189
+ gqlExtra
190
+ };
191
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/adapter/http-adapter.browser.ts", "../../src/adapter/adapter.ts", "../../src/adapter/adapter.types.ts", "../../src/adapter/adapter.utils.ts", "../../src/adapter/adapter.constants.ts"],
4
+ "sourcesContent": ["import {\n getResponseHeaders,\n parseResponse,\n getErrorMessage,\n Adapter,\n QueryParamsType,\n stringifyKey,\n} from \"@hyper-fetch/core\";\n\nimport {\n gqlExtra,\n GraphqlAdapterType,\n defaultTimeout,\n getRequestValues,\n GraphqlMethod,\n GraphQlExtraType,\n GraphQlEndpointType,\n gqlEndpointMapper,\n gqlEndpointNameMapper,\n} from \"adapter\";\n\nexport const getGqlAdapter = (): GraphqlAdapterType =>\n new Adapter<\n Partial<XMLHttpRequest>,\n GraphqlMethod,\n number,\n GraphQlExtraType,\n QueryParamsType | string,\n undefined,\n GraphQlEndpointType\n >({\n name: \"graphql-browser\",\n defaultMethod: GraphqlMethod.POST,\n defaultExtra: gqlExtra,\n systemErrorStatus: 0,\n systemErrorExtra: gqlExtra,\n })\n .onInitialize(({ client }) => {\n client.setCacheKeyMapper((request) => {\n return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${stringifyKey(request.params)}-${stringifyKey(request.queryParams)}`;\n });\n client.setQueryKeyMapper((request) => {\n return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${stringifyKey(request.params)}-${stringifyKey(request.queryParams)}`;\n });\n client.setAbortKeyMapper((request) => {\n return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${request.cancelable}`;\n });\n })\n .setInternalErrorMapping((error) => [error])\n .setDevtoolsEndpointGetter(gqlEndpointNameMapper)\n .setEndpointMapper(gqlEndpointMapper)\n .setFetcher(\n async ({\n request,\n adapterOptions,\n headers,\n onError,\n onResponseEnd,\n onTimeoutError,\n onRequestEnd,\n createAbortListener,\n onResponseProgress,\n onRequestProgress,\n onResponseStart,\n onBeforeRequest,\n onRequestStart,\n onSuccess,\n }) => {\n const { fullUrl, payload } = getRequestValues(request);\n\n const xhr = new XMLHttpRequest();\n xhr.timeout = defaultTimeout;\n\n const onAbort = () => xhr.abort();\n\n // Inject xhr options\n if (adapterOptions) {\n Object.entries(adapterOptions).forEach(([name, value]) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n xhr[name] = value;\n });\n }\n\n // Open connection\n xhr.open(request.method, fullUrl, true);\n\n // Set Headers\n Object.entries(headers).forEach(([name, value]) => xhr.setRequestHeader(name, value as string));\n\n // Listen to abort signal\n const unmountListener = createAbortListener({ status: 0, extra: gqlExtra, onAbort });\n\n // Request handlers\n xhr.upload.onprogress = onRequestProgress;\n\n // Response handlers\n xhr.onloadstart = (): void => {\n onRequestEnd();\n onResponseStart();\n };\n\n xhr.onprogress = onResponseProgress;\n\n xhr.onloadend = () => {\n onResponseEnd();\n unmountListener();\n };\n\n /* istanbul ignore next */\n xhr.ontimeout = () => onTimeoutError({ status: 0, extra: gqlExtra });\n\n // Data handler\n xhr.onreadystatechange = (e: Event) => {\n const event = e as unknown as ProgressEvent<XMLHttpRequest>;\n const finishedState = 4;\n\n if (event.target && event.target.readyState === finishedState) {\n const { status } = event.target;\n const response = parseResponse(event.target.response);\n const data = response.data ?? null;\n const errors = response?.errors || null;\n const extensions = response?.extensions || {};\n const failure = response?.errors || status > 399 || status === 0;\n const responseHeaders = getResponseHeaders(xhr.getAllResponseHeaders());\n\n if (failure) {\n const error = errors || [getErrorMessage()];\n // delay to finish after onabort/ontimeout\n onError({ error, status, extra: { headers: responseHeaders, extensions } });\n } else {\n onSuccess({\n data,\n error: errors,\n status,\n extra: { headers: responseHeaders, extensions },\n });\n }\n }\n };\n\n // Start request\n onBeforeRequest();\n onRequestStart();\n\n xhr.send(payload);\n },\n );\n", "import * as browser from \"@browser-adapter\";\nimport * as server from \"@server-adapter\";\n\nimport { GraphqlAdapterType } from \"./adapter.types\";\n\nexport const GraphqlAdapter = (): GraphqlAdapterType => {\n if (typeof XMLHttpRequest !== \"undefined\") {\n return browser.getGqlAdapter();\n }\n return server.getGqlAdapter();\n};\n", "import { Adapter, EmptyTypes, QueryParamsType } from \"@hyper-fetch/core\";\nimport { DocumentNode } from \"graphql/language/ast\";\n\nexport enum GraphqlMethod {\n POST = \"POST\",\n GET = \"GET\",\n}\n\nexport type GraphQlExtraType = { headers: HeadersInit; extensions: Record<string, any> };\n\nexport type GraphQlEndpointType = string | DocumentNode;\n\nexport type GraphqlAdapterType = Adapter<\n Partial<XMLHttpRequest>,\n GraphqlMethod,\n number,\n GraphQlExtraType,\n QueryParamsType | string,\n undefined,\n GraphQlEndpointType,\n (endpoint: GraphQlEndpointType) => string\n>;\n\n// Extract\n\ntype GqlParamType = boolean | string | number | Record<string, any> | EmptyTypes;\n\nexport type ExtractGqlRouteParams<T extends string> = string extends T\n ? EmptyTypes\n : T extends `${string}query ${infer Parameters} {${infer QueryRest}`\n ? Parameters extends `${string}$${infer Param},${infer Rest}`\n ? GqlParameter<Param, Rest> &\n // eslint-disable-next-line @typescript-eslint/ban-types\n (ExtractGqlRouteParams<QueryRest> extends EmptyTypes ? {} : ExtractGqlRouteParams<QueryRest>)\n : Parameters extends `${string}$${infer Param})${infer Rest}`\n ? GqlParameter<Param, Rest> &\n // eslint-disable-next-line @typescript-eslint/ban-types\n (ExtractGqlRouteParams<QueryRest> extends EmptyTypes ? {} : ExtractGqlRouteParams<QueryRest>)\n : EmptyTypes\n : T extends `${string}$${infer Parameters},${infer Rest}`\n ? GqlParameter<Parameters, Rest>\n : T extends `${string}$${infer Parameters})${infer Rest}`\n ? GqlParameter<Parameters, Rest>\n : EmptyTypes;\n\nexport type GqlParameter<T extends string, Rest extends string> = T extends `${infer Param}:${string}!`\n ? { [k in Param]: GqlParamType } & (ExtractGqlRouteParams<Rest> extends EmptyTypes\n ? // eslint-disable-next-line @typescript-eslint/ban-types\n {}\n : ExtractGqlRouteParams<Rest>)\n : T extends `${infer Param}:${string}`\n ? { [k in Param]?: GqlParamType } & (ExtractGqlRouteParams<Rest> extends EmptyTypes\n ? // eslint-disable-next-line @typescript-eslint/ban-types\n {}\n : ExtractGqlRouteParams<Rest>)\n : EmptyTypes;\n", "import { RequestInstance, HttpMethods, stringifyQueryParams } from \"@hyper-fetch/core\";\nimport { print, parse, OperationDefinitionNode } from \"graphql\";\n\nimport { GraphQlEndpointType } from \"adapter\";\n\nexport const getRequestValues = <R extends RequestInstance>(request: R) => {\n const isPostRequest = request.method === HttpMethods.POST;\n\n const query = request.endpoint;\n const variables = request.payload;\n\n const fullUrl = isPostRequest ? request.client.url : request.client.url + stringifyQueryParams({ query, variables });\n\n const payload = isPostRequest\n ? JSON.stringify({\n query,\n variables,\n })\n : null;\n\n return { fullUrl, payload };\n};\n\nexport const gqlEndpointMapper = <E extends GraphQlEndpointType>(endpoint: E): string => {\n if (typeof endpoint === \"string\") {\n return endpoint;\n }\n return print(endpoint);\n};\n\nexport const gqlEndpointNameMapper = (endpoint: string): string => {\n try {\n const ast = parse(endpoint);\n const operationDefinition = ast.definitions.find(\n (def): def is OperationDefinitionNode => def.kind === \"OperationDefinition\",\n );\n\n if (operationDefinition) {\n if (operationDefinition.name?.value) {\n return operationDefinition.name.value;\n }\n\n const selection = operationDefinition.selectionSet.selections[0];\n if (selection?.kind === \"Field\") {\n return selection.name.value;\n }\n }\n } catch (error) {\n // We can ignore this error and just return some fallback\n }\n\n // Fallback for invalid gql queries or something else\n const clearedQuery = endpoint\n .replace(/(query|mutation|subscription)/, \"\")\n .replace(/[{}().,:]/g, \" \")\n .trim();\n const [name] = clearedQuery.split(\" \");\n\n return name || \"graphql-request\";\n};\n", "import { Time } from \"@hyper-fetch/core\";\n\nimport { GraphQlExtraType } from \"./adapter.types\";\n\nexport const defaultTimeout = Time.SEC * 5;\n\nexport const gqlExtra: GraphQlExtraType = {\n headers: {},\n extensions: {},\n};\n"],
5
+ "mappings": "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",
6
+ "names": ["GraphqlMethod"]
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,33 +1,34 @@
1
- import * as _hyper_fetch_core from '@hyper-fetch/core';
2
- import { ClientInstance, AdapterType, QueryParamsType, NegativeTypes, RequestInstance } from '@hyper-fetch/core';
1
+ import { Adapter, QueryParamsType, EmptyTypes, RequestInstance } from '@hyper-fetch/core';
3
2
  import { DocumentNode } from 'graphql/language/ast';
4
3
 
5
- declare const graphqlAdapter: (client: ClientInstance) => _hyper_fetch_core.Client<any, GraphQLAdapterType, <E extends GraphQlEndpointType>(endpoint: E) => string>;
6
-
7
- declare enum GraphQlMethod {
4
+ declare enum GraphqlMethod {
8
5
  POST = "POST",
9
6
  GET = "GET"
10
7
  }
11
8
  type GraphQlExtraType = {
12
9
  headers: HeadersInit;
10
+ extensions: Record<string, any>;
13
11
  };
14
12
  type GraphQlEndpointType = string | DocumentNode;
15
- type GraphQLAdapterType = AdapterType<Partial<XMLHttpRequest>, GraphQlMethod, number, GraphQlExtraType, QueryParamsType | string, GraphQlEndpointType>;
16
- type GqlParamType = boolean | string | number | Record<string, any> | NegativeTypes;
17
- type ExtractGqlRouteParams<T extends string> = string extends T ? NegativeTypes : T extends `${string}query ${infer Parameters} {${infer QueryRest}` ? Parameters extends `${string}$${infer Param},${infer Rest}` ? GqlParameter<Param, Rest> & (ExtractGqlRouteParams<QueryRest> extends NegativeTypes ? {} : ExtractGqlRouteParams<QueryRest>) : Parameters extends `${string}$${infer Param})${infer Rest}` ? GqlParameter<Param, Rest> & (ExtractGqlRouteParams<QueryRest> extends NegativeTypes ? {} : ExtractGqlRouteParams<QueryRest>) : NegativeTypes : T extends `${string}$${infer Parameters},${infer Rest}` ? GqlParameter<Parameters, Rest> : T extends `${string}$${infer Parameters})${infer Rest}` ? GqlParameter<Parameters, Rest> : NegativeTypes;
13
+ type GraphqlAdapterType = Adapter<Partial<XMLHttpRequest>, GraphqlMethod, number, GraphQlExtraType, QueryParamsType | string, undefined, GraphQlEndpointType, (endpoint: GraphQlEndpointType) => string>;
14
+ type GqlParamType = boolean | string | number | Record<string, any> | EmptyTypes;
15
+ type ExtractGqlRouteParams<T extends string> = string extends T ? EmptyTypes : T extends `${string}query ${infer Parameters} {${infer QueryRest}` ? Parameters extends `${string}$${infer Param},${infer Rest}` ? GqlParameter<Param, Rest> & (ExtractGqlRouteParams<QueryRest> extends EmptyTypes ? {} : ExtractGqlRouteParams<QueryRest>) : Parameters extends `${string}$${infer Param})${infer Rest}` ? GqlParameter<Param, Rest> & (ExtractGqlRouteParams<QueryRest> extends EmptyTypes ? {} : ExtractGqlRouteParams<QueryRest>) : EmptyTypes : T extends `${string}$${infer Parameters},${infer Rest}` ? GqlParameter<Parameters, Rest> : T extends `${string}$${infer Parameters})${infer Rest}` ? GqlParameter<Parameters, Rest> : EmptyTypes;
18
16
  type GqlParameter<T extends string, Rest extends string> = T extends `${infer Param}:${string}!` ? {
19
17
  [k in Param]: GqlParamType;
20
- } & (ExtractGqlRouteParams<Rest> extends NegativeTypes ? {} : ExtractGqlRouteParams<Rest>) : T extends `${infer Param}:${string}` ? {
18
+ } & (ExtractGqlRouteParams<Rest> extends EmptyTypes ? {} : ExtractGqlRouteParams<Rest>) : T extends `${infer Param}:${string}` ? {
21
19
  [k in Param]?: GqlParamType;
22
- } & (ExtractGqlRouteParams<Rest> extends NegativeTypes ? {} : ExtractGqlRouteParams<Rest>) : NegativeTypes;
20
+ } & (ExtractGqlRouteParams<Rest> extends EmptyTypes ? {} : ExtractGqlRouteParams<Rest>) : EmptyTypes;
21
+
22
+ declare const GraphqlAdapter: () => GraphqlAdapterType;
23
23
 
24
- declare const getRequestValues: (request: RequestInstance) => {
24
+ declare const getRequestValues: <R extends RequestInstance>(request: R) => {
25
25
  fullUrl: string;
26
- payload: string;
27
- method: any;
26
+ payload: string | null;
28
27
  };
28
+ declare const gqlEndpointMapper: <E extends GraphQlEndpointType>(endpoint: E) => string;
29
+ declare const gqlEndpointNameMapper: (endpoint: string) => string;
29
30
 
30
31
  declare const defaultTimeout: number;
31
32
  declare const gqlExtra: GraphQlExtraType;
32
33
 
33
- export { ExtractGqlRouteParams, GqlParameter, GraphQLAdapterType, GraphQlEndpointType, GraphQlExtraType, GraphQlMethod, defaultTimeout, getRequestValues, gqlExtra, graphqlAdapter };
34
+ export { type ExtractGqlRouteParams, type GqlParameter, type GraphQlEndpointType, type GraphQlExtraType, GraphqlAdapter, type GraphqlAdapterType, GraphqlMethod, defaultTimeout, getRequestValues, gqlEndpointMapper, gqlEndpointNameMapper, gqlExtra };
package/dist/index.js ADDED
@@ -0,0 +1,330 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var __async = (__this, __arguments, generator) => {
30
+ return new Promise((resolve, reject) => {
31
+ var fulfilled = (value) => {
32
+ try {
33
+ step(generator.next(value));
34
+ } catch (e) {
35
+ reject(e);
36
+ }
37
+ };
38
+ var rejected = (value) => {
39
+ try {
40
+ step(generator.throw(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ };
45
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
46
+ step((generator = generator.apply(__this, __arguments)).next());
47
+ });
48
+ };
49
+
50
+ // src/index.ts
51
+ var src_exports = {};
52
+ __export(src_exports, {
53
+ GraphqlAdapter: () => GraphqlAdapter,
54
+ GraphqlMethod: () => GraphqlMethod,
55
+ defaultTimeout: () => defaultTimeout,
56
+ getRequestValues: () => getRequestValues,
57
+ gqlEndpointMapper: () => gqlEndpointMapper,
58
+ gqlEndpointNameMapper: () => gqlEndpointNameMapper,
59
+ gqlExtra: () => gqlExtra
60
+ });
61
+ module.exports = __toCommonJS(src_exports);
62
+
63
+ // src/adapter/http-adapter.browser.ts
64
+ var import_core = require("@hyper-fetch/core");
65
+ var getGqlAdapter = () => new import_core.Adapter({
66
+ name: "graphql-browser",
67
+ defaultMethod: "POST" /* POST */,
68
+ defaultExtra: gqlExtra,
69
+ systemErrorStatus: 0,
70
+ systemErrorExtra: gqlExtra
71
+ }).onInitialize(({ client }) => {
72
+ client.setCacheKeyMapper((request) => {
73
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${(0, import_core.stringifyKey)(request.params)}-${(0, import_core.stringifyKey)(request.queryParams)}`;
74
+ });
75
+ client.setQueryKeyMapper((request) => {
76
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${(0, import_core.stringifyKey)(request.params)}-${(0, import_core.stringifyKey)(request.queryParams)}`;
77
+ });
78
+ client.setAbortKeyMapper((request) => {
79
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${request.cancelable}`;
80
+ });
81
+ }).setInternalErrorMapping((error) => [error]).setDevtoolsEndpointGetter(gqlEndpointNameMapper).setEndpointMapper(gqlEndpointMapper).setFetcher(
82
+ (_0) => __async(void 0, [_0], function* ({
83
+ request,
84
+ adapterOptions,
85
+ headers,
86
+ onError,
87
+ onResponseEnd,
88
+ onTimeoutError,
89
+ onRequestEnd,
90
+ createAbortListener,
91
+ onResponseProgress,
92
+ onRequestProgress,
93
+ onResponseStart,
94
+ onBeforeRequest,
95
+ onRequestStart,
96
+ onSuccess
97
+ }) {
98
+ const { fullUrl, payload } = getRequestValues(request);
99
+ const xhr = new XMLHttpRequest();
100
+ xhr.timeout = defaultTimeout;
101
+ const onAbort = () => xhr.abort();
102
+ if (adapterOptions) {
103
+ Object.entries(adapterOptions).forEach(([name, value]) => {
104
+ xhr[name] = value;
105
+ });
106
+ }
107
+ xhr.open(request.method, fullUrl, true);
108
+ Object.entries(headers).forEach(([name, value]) => xhr.setRequestHeader(name, value));
109
+ const unmountListener = createAbortListener({ status: 0, extra: gqlExtra, onAbort });
110
+ xhr.upload.onprogress = onRequestProgress;
111
+ xhr.onloadstart = () => {
112
+ onRequestEnd();
113
+ onResponseStart();
114
+ };
115
+ xhr.onprogress = onResponseProgress;
116
+ xhr.onloadend = () => {
117
+ onResponseEnd();
118
+ unmountListener();
119
+ };
120
+ xhr.ontimeout = () => onTimeoutError({ status: 0, extra: gqlExtra });
121
+ xhr.onreadystatechange = (e) => {
122
+ var _a;
123
+ const event = e;
124
+ const finishedState = 4;
125
+ if (event.target && event.target.readyState === finishedState) {
126
+ const { status } = event.target;
127
+ const response = (0, import_core.parseResponse)(event.target.response);
128
+ const data = (_a = response.data) != null ? _a : null;
129
+ const errors = (response == null ? void 0 : response.errors) || null;
130
+ const extensions = (response == null ? void 0 : response.extensions) || {};
131
+ const failure = (response == null ? void 0 : response.errors) || status > 399 || status === 0;
132
+ const responseHeaders = (0, import_core.getResponseHeaders)(xhr.getAllResponseHeaders());
133
+ if (failure) {
134
+ const error = errors || [(0, import_core.getErrorMessage)()];
135
+ onError({ error, status, extra: { headers: responseHeaders, extensions } });
136
+ } else {
137
+ onSuccess({
138
+ data,
139
+ error: errors,
140
+ status,
141
+ extra: { headers: responseHeaders, extensions }
142
+ });
143
+ }
144
+ }
145
+ };
146
+ onBeforeRequest();
147
+ onRequestStart();
148
+ xhr.send(payload);
149
+ })
150
+ );
151
+
152
+ // src/adapter/http-adapter.server.ts
153
+ var import_core2 = require("@hyper-fetch/core");
154
+ var import_http = __toESM(require("http"));
155
+ var import_https = __toESM(require("https"));
156
+ var getGqlAdapter2 = () => new import_core2.Adapter({
157
+ name: "graphql-server",
158
+ defaultMethod: "POST" /* POST */,
159
+ defaultExtra: gqlExtra,
160
+ systemErrorStatus: 0,
161
+ systemErrorExtra: gqlExtra
162
+ }).onInitialize(({ client }) => {
163
+ client.setCacheKeyMapper((request) => {
164
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${JSON.stringify(request.params)}-${JSON.stringify(request.queryParams)}`;
165
+ });
166
+ client.setQueryKeyMapper((request) => {
167
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${JSON.stringify(request.params)}-${JSON.stringify(request.queryParams)}`;
168
+ });
169
+ client.setAbortKeyMapper((request) => {
170
+ return `${request.method}_${gqlEndpointNameMapper(request.endpoint)}-${request.cancelable}`;
171
+ });
172
+ }).setInternalErrorMapping((error) => [error]).setDevtoolsEndpointGetter(gqlEndpointNameMapper).setEndpointMapper(gqlEndpointMapper).setFetcher(
173
+ (_0) => __async(void 0, [_0], function* ({
174
+ request,
175
+ adapterOptions,
176
+ headers,
177
+ onError,
178
+ onResponseEnd,
179
+ onTimeoutError,
180
+ onRequestEnd,
181
+ createAbortListener,
182
+ getAbortController,
183
+ onResponseProgress,
184
+ onResponseStart,
185
+ onBeforeRequest,
186
+ onRequestStart,
187
+ onSuccess
188
+ }) {
189
+ var _a;
190
+ const { fullUrl, payload } = getRequestValues(request);
191
+ const httpClient = request.client.url.includes("https://") ? import_https.default : import_http.default;
192
+ const options = {
193
+ method: request.method,
194
+ headers,
195
+ timeout: defaultTimeout,
196
+ signal: (_a = getAbortController()) == null ? void 0 : _a.signal
197
+ };
198
+ Object.entries(adapterOptions || {}).forEach(([name, value]) => {
199
+ options[name] = value;
200
+ });
201
+ onBeforeRequest();
202
+ const unmountListener = createAbortListener({
203
+ status: 0,
204
+ extra: gqlExtra
205
+ });
206
+ const httpRequest = httpClient.request(fullUrl, options, (response) => {
207
+ response.setEncoding("utf8");
208
+ let chunks = "";
209
+ const totalDownloadBytes = Number(response.headers["content-length"]);
210
+ let downloadedBytes = 0;
211
+ onRequestStart();
212
+ response.on("data", (chunk) => {
213
+ if (!chunks) {
214
+ onRequestEnd();
215
+ onResponseStart();
216
+ }
217
+ downloadedBytes += chunk.length;
218
+ chunks += chunk;
219
+ onResponseProgress({ total: totalDownloadBytes, loaded: downloadedBytes });
220
+ });
221
+ response.on("end", () => {
222
+ const { statusCode = 0 } = response;
223
+ const success = String(statusCode).startsWith("2") || String(statusCode).startsWith("3");
224
+ if (success) {
225
+ const { data, errors, extensions } = (0, import_core2.parseResponse)(chunks);
226
+ onSuccess({
227
+ data: data != null ? data : null,
228
+ error: errors,
229
+ status: statusCode,
230
+ extra: { headers: response.headers, extensions: extensions != null ? extensions : {} }
231
+ });
232
+ } else {
233
+ const result = (0, import_core2.parseErrorResponse)(chunks);
234
+ const error = "errors" in result ? result.errors : null;
235
+ const extensions = "extensions" in result ? result.extensions : {};
236
+ onError({
237
+ error: error != null ? error : [(0, import_core2.getErrorMessage)()],
238
+ status: statusCode,
239
+ extra: { headers: response.headers, extensions }
240
+ });
241
+ }
242
+ unmountListener();
243
+ onResponseEnd();
244
+ });
245
+ });
246
+ httpRequest.on("timeout", () => onTimeoutError({ status: 0, extra: gqlExtra }));
247
+ httpRequest.on("error", (error) => onError({ error, status: 0, extra: gqlExtra }));
248
+ if (payload) {
249
+ httpRequest.write(payload);
250
+ }
251
+ httpRequest.end();
252
+ })
253
+ );
254
+
255
+ // src/adapter/adapter.ts
256
+ var GraphqlAdapter = () => {
257
+ if (typeof XMLHttpRequest !== "undefined") {
258
+ return getGqlAdapter();
259
+ }
260
+ return getGqlAdapter2();
261
+ };
262
+
263
+ // src/adapter/adapter.types.ts
264
+ var GraphqlMethod = /* @__PURE__ */ ((GraphqlMethod2) => {
265
+ GraphqlMethod2["POST"] = "POST";
266
+ GraphqlMethod2["GET"] = "GET";
267
+ return GraphqlMethod2;
268
+ })(GraphqlMethod || {});
269
+
270
+ // src/adapter/adapter.utils.ts
271
+ var import_core3 = require("@hyper-fetch/core");
272
+ var import_graphql = require("graphql");
273
+ var getRequestValues = (request) => {
274
+ const isPostRequest = request.method === import_core3.HttpMethods.POST;
275
+ const query = request.endpoint;
276
+ const variables = request.payload;
277
+ const fullUrl = isPostRequest ? request.client.url : request.client.url + (0, import_core3.stringifyQueryParams)({ query, variables });
278
+ const payload = isPostRequest ? JSON.stringify({
279
+ query,
280
+ variables
281
+ }) : null;
282
+ return { fullUrl, payload };
283
+ };
284
+ var gqlEndpointMapper = (endpoint) => {
285
+ if (typeof endpoint === "string") {
286
+ return endpoint;
287
+ }
288
+ return (0, import_graphql.print)(endpoint);
289
+ };
290
+ var gqlEndpointNameMapper = (endpoint) => {
291
+ var _a;
292
+ try {
293
+ const ast = (0, import_graphql.parse)(endpoint);
294
+ const operationDefinition = ast.definitions.find(
295
+ (def) => def.kind === "OperationDefinition"
296
+ );
297
+ if (operationDefinition) {
298
+ if ((_a = operationDefinition.name) == null ? void 0 : _a.value) {
299
+ return operationDefinition.name.value;
300
+ }
301
+ const selection = operationDefinition.selectionSet.selections[0];
302
+ if ((selection == null ? void 0 : selection.kind) === "Field") {
303
+ return selection.name.value;
304
+ }
305
+ }
306
+ } catch (error) {
307
+ }
308
+ const clearedQuery = endpoint.replace(/(query|mutation|subscription)/, "").replace(/[{}().,:]/g, " ").trim();
309
+ const [name] = clearedQuery.split(" ");
310
+ return name || "graphql-request";
311
+ };
312
+
313
+ // src/adapter/adapter.constants.ts
314
+ var import_core4 = require("@hyper-fetch/core");
315
+ var defaultTimeout = import_core4.Time.SEC * 5;
316
+ var gqlExtra = {
317
+ headers: {},
318
+ extensions: {}
319
+ };
320
+ // Annotate the CommonJS export names for ESM import in node:
321
+ 0 && (module.exports = {
322
+ GraphqlAdapter,
323
+ GraphqlMethod,
324
+ defaultTimeout,
325
+ getRequestValues,
326
+ gqlEndpointMapper,
327
+ gqlEndpointNameMapper,
328
+ gqlExtra
329
+ });
330
+ //# sourceMappingURL=index.js.map