@ctx-core/graphql-client 7.0.116 → 7.0.117
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/CHANGELOG.md +10 -0
- package/lib/graphql_fetch.js +1 -2
- package/lib/graphql_fetch.js.map +1 -1
- package/lib/graphql_fetch_.js +2 -4
- package/lib/graphql_fetch_.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/lib/graphql_fetch.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { graphql_fetch_ } from './graphql_fetch_.js';
|
|
2
2
|
import { graphql_url_ } from './graphql_url_.js';
|
|
3
3
|
let in_graphql_fetch;
|
|
4
|
-
export function graphql_fetch(body, fn_in_http_opts = {
|
|
5
|
-
}) {
|
|
4
|
+
export function graphql_fetch(body, fn_in_http_opts = {}) {
|
|
6
5
|
if (!in_graphql_fetch) {
|
|
7
6
|
in_graphql_fetch = graphql_fetch_({
|
|
8
7
|
url: graphql_url_()
|
package/lib/graphql_fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphql_fetch.ts"],"sourcesContent":["import { graphql_fetch_, graphql_fetch_T } from './graphql_fetch_.js'\nimport { graphql_url_ } from './graphql_url_.js'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nlet in_graphql_fetch: graphql_fetch_T\nexport function graphql_fetch<data_T extends unknown = unknown>(\n\tbody:string,\n\tfn_in_http_opts:FetchHttpOpts = {},\n):Promise<graphql_fetch_response_T<data_T>> {\n\tif (!in_graphql_fetch) {\n\t\tin_graphql_fetch = graphql_fetch_<data_T>({\n\t\t\turl: graphql_url_(),\n\t\t})\n\t}\n\treturn in_graphql_fetch(body, fn_in_http_opts) as Promise<graphql_fetch_response_T<data_T>>\n}\nexport interface graphql_fetch_response_T<data_T extends unknown = unknown> {\n\tdata: data_T\n}\nexport {\n\tgraphql_fetch as fetch_graphql,\n\tgraphql_fetch as fetch__graphql,\n}\n"],"names":["graphql_fetch_","graphql_url_","in_graphql_fetch","graphql_fetch","body","fn_in_http_opts","url","fetch_graphql","fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAyB,CAAqB;AACrE,MAAM,GAAGC,YAAY,QAAQ,CAAmB;AAEhD,GAAG,CAACC,gBAAgB;AACpB,MAAM,UAAUC,aAAa,CAC5BC,IAAW,EACXC,eAA6B,GAAG,CAAC
|
|
1
|
+
{"version":3,"sources":["../src/graphql_fetch.ts"],"sourcesContent":["import { graphql_fetch_, graphql_fetch_T } from './graphql_fetch_.js'\nimport { graphql_url_ } from './graphql_url_.js'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nlet in_graphql_fetch: graphql_fetch_T\nexport function graphql_fetch<data_T extends unknown = unknown>(\n\tbody:string,\n\tfn_in_http_opts:FetchHttpOpts = {},\n):Promise<graphql_fetch_response_T<data_T>> {\n\tif (!in_graphql_fetch) {\n\t\tin_graphql_fetch = graphql_fetch_<data_T>({\n\t\t\turl: graphql_url_(),\n\t\t})\n\t}\n\treturn in_graphql_fetch(body, fn_in_http_opts) as Promise<graphql_fetch_response_T<data_T>>\n}\nexport interface graphql_fetch_response_T<data_T extends unknown = unknown> {\n\tdata: data_T\n}\nexport {\n\tgraphql_fetch as fetch_graphql,\n\tgraphql_fetch as fetch__graphql,\n}\n"],"names":["graphql_fetch_","graphql_url_","in_graphql_fetch","graphql_fetch","body","fn_in_http_opts","url","fetch_graphql","fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAyB,CAAqB;AACrE,MAAM,GAAGC,YAAY,QAAQ,CAAmB;AAEhD,GAAG,CAACC,gBAAgB;AACpB,MAAM,UAAUC,aAAa,CAC5BC,IAAW,EACXC,eAA6B,GAAG,CAAC,CAAC,EACS,CAAC;IAC5C,EAAE,GAAGH,gBAAgB,EAAE,CAAC;QACvBA,gBAAgB,GAAGF,cAAc,CAAS,CAAC;YAC1CM,GAAG,EAAEL,YAAY;QAClB,CAAC;IACF,CAAC;IACD,MAAM,CAACC,gBAAgB,CAACE,IAAI,EAAEC,eAAe;AAC9C,CAAC;AAID,MAAM,GACLF,aAAa,IAAII,aAAa,EAC9BJ,aAAa,IAAIK,cAAc"}
|
package/lib/graphql_fetch_.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { fetch } from '@ctx-core/fetch';
|
|
2
2
|
import { assign } from '@ctx-core/object';
|
|
3
|
-
export function graphql_fetch_(in_http_opts = {
|
|
4
|
-
}) {
|
|
5
|
-
return async function graphql_fetch(body, fn_in_http_opts = {
|
|
6
|
-
}) {
|
|
3
|
+
export function graphql_fetch_(in_http_opts = {}) {
|
|
4
|
+
return async function graphql_fetch(body, fn_in_http_opts = {}) {
|
|
7
5
|
const url = fn_in_http_opts.url || in_http_opts.url;
|
|
8
6
|
if (!url) {
|
|
9
7
|
throw `no url prop`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphql_fetch_.ts"],"sourcesContent":["import { fetch } from '@ctx-core/fetch'\nimport { assign } from '@ctx-core/object'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nexport function graphql_fetch_<O1 extends unknown = unknown>(\n\tin_http_opts = {} as FetchHttpOpts\n):graphql_fetch_T<O1> {\n\treturn async function graphql_fetch<O2 extends unknown = O1>(\n\t\tbody:string,\n\t\tfn_in_http_opts:FetchHttpOpts = {},\n\t):Promise<O2> {\n\t\tconst url = fn_in_http_opts.url || in_http_opts.url\n\t\tif (!url) {\n\t\t\tthrow `no url prop`\n\t\t}\n\t\tconst response = await fetch(url, assign({\n\t\t\tmethod: 'POST',\n\t\t\theaders: assign({\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t}, in_http_opts.headers, fn_in_http_opts.headers),\n\t\t\tbody,\n\t\t}, in_http_opts, fn_in_http_opts))\n\t\tif (!response.ok) {\n\t\t\tif (process.env.NODE_ENV === 'production') {\n\t\t\t\tconsole.error(await response.text())\n\t\t\t\tthrow `Error fetching graphql`\n\t\t\t} else {\n\t\t\t\tthrow (await response.text())\n\t\t\t}\n\t\t}\n\t\tconst payload = await response.json()\n\t\tif (payload.errors) throw payload\n\t\treturn payload as O2\n\t}\n}\nexport type graphql_fetch_T<O extends unknown = unknown> =\n\t(body:string, fn_in_http_opts:FetchHttpOpts)=>Promise<O>\nexport {\n\tgraphql_fetch_ as _graphql_fetch,\n\tgraphql_fetch_ as _fetch__graphql,\n}\n"],"names":["fetch","assign","graphql_fetch_","in_http_opts","graphql_fetch","body","fn_in_http_opts","url","response","method","headers","ok","process","env","NODE_ENV","console","error","text","payload","json","errors","_graphql_fetch","_fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAiB;AACvC,MAAM,GAAGC,MAAM,QAAQ,CAAkB;AAEzC,MAAM,UAAUC,cAAc,CAC7BC,YAAY,GAAG,CAAC
|
|
1
|
+
{"version":3,"sources":["../src/graphql_fetch_.ts"],"sourcesContent":["import { fetch } from '@ctx-core/fetch'\nimport { assign } from '@ctx-core/object'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nexport function graphql_fetch_<O1 extends unknown = unknown>(\n\tin_http_opts = {} as FetchHttpOpts\n):graphql_fetch_T<O1> {\n\treturn async function graphql_fetch<O2 extends unknown = O1>(\n\t\tbody:string,\n\t\tfn_in_http_opts:FetchHttpOpts = {},\n\t):Promise<O2> {\n\t\tconst url = fn_in_http_opts.url || in_http_opts.url\n\t\tif (!url) {\n\t\t\tthrow `no url prop`\n\t\t}\n\t\tconst response = await fetch(url, assign({\n\t\t\tmethod: 'POST',\n\t\t\theaders: assign({\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t}, in_http_opts.headers, fn_in_http_opts.headers),\n\t\t\tbody,\n\t\t}, in_http_opts, fn_in_http_opts))\n\t\tif (!response.ok) {\n\t\t\tif (process.env.NODE_ENV === 'production') {\n\t\t\t\tconsole.error(await response.text())\n\t\t\t\tthrow `Error fetching graphql`\n\t\t\t} else {\n\t\t\t\tthrow (await response.text())\n\t\t\t}\n\t\t}\n\t\tconst payload = await response.json()\n\t\tif (payload.errors) throw payload\n\t\treturn payload as O2\n\t}\n}\nexport type graphql_fetch_T<O extends unknown = unknown> =\n\t(body:string, fn_in_http_opts:FetchHttpOpts)=>Promise<O>\nexport {\n\tgraphql_fetch_ as _graphql_fetch,\n\tgraphql_fetch_ as _fetch__graphql,\n}\n"],"names":["fetch","assign","graphql_fetch_","in_http_opts","graphql_fetch","body","fn_in_http_opts","url","response","method","headers","ok","process","env","NODE_ENV","console","error","text","payload","json","errors","_graphql_fetch","_fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAiB;AACvC,MAAM,GAAGC,MAAM,QAAQ,CAAkB;AAEzC,MAAM,UAAUC,cAAc,CAC7BC,YAAY,GAAG,CAAC,CAAC,EACI,CAAC;IACtB,MAAM,gBAAgBC,aAAa,CAClCC,IAAW,EACXC,eAA6B,GAAG,CAAC,CAAC,EACrB,CAAC;QACd,KAAK,CAACC,GAAG,GAAGD,eAAe,CAACC,GAAG,IAAIJ,YAAY,CAACI,GAAG;QACnD,EAAE,GAAGA,GAAG,EAAE,CAAC;YACV,KAAK,EAAE,WAAW;QACnB,CAAC;QACD,KAAK,CAACC,QAAQ,GAAG,KAAK,CAACR,KAAK,CAACO,GAAG,EAAEN,MAAM,CAAC,CAAC;YACzCQ,MAAM,EAAE,CAAM;YACdC,OAAO,EAAET,MAAM,CAAC,CAAC;gBAChB,CAAc,eAAE,CAAkB;YACnC,CAAC,EAAEE,YAAY,CAACO,OAAO,EAAEJ,eAAe,CAACI,OAAO;YAChDL,IAAI;QACL,CAAC,EAAEF,YAAY,EAAEG,eAAe;QAChC,EAAE,GAAGE,QAAQ,CAACG,EAAE,EAAE,CAAC;YAClB,EAAE,EAAEC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,CAAY,aAAE,CAAC;gBAC3CC,OAAO,CAACC,KAAK,CAAC,KAAK,CAACR,QAAQ,CAACS,IAAI;gBACjC,KAAK,EAAE,sBAAsB;YAC9B,CAAC,MAAM,CAAC;gBACP,KAAK,CAAE,KAAK,CAACT,QAAQ,CAACS,IAAI;YAC3B,CAAC;QACF,CAAC;QACD,KAAK,CAACC,OAAO,GAAG,KAAK,CAACV,QAAQ,CAACW,IAAI;QACnC,EAAE,EAAED,OAAO,CAACE,MAAM,EAAE,KAAK,CAACF,OAAO;QACjC,MAAM,CAACA,OAAO;IACf,CAAC;AACF,CAAC;AAGD,MAAM,GACLhB,cAAc,IAAImB,cAAc,EAChCnB,cAAc,IAAIoB,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/graphql-client",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.117",
|
|
4
4
|
"description": "ctx-core graphql-client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ctx-core/dom": "^11.1.
|
|
29
|
-
"@ctx-core/fetch": "^11.0.
|
|
30
|
-
"@ctx-core/object": "^22.0.
|
|
28
|
+
"@ctx-core/dom": "^11.1.3",
|
|
29
|
+
"@ctx-core/fetch": "^11.0.106",
|
|
30
|
+
"@ctx-core/object": "^22.0.10"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@swc/cli": "^0.1.55",
|
|
34
|
-
"@swc/core": "^1.2.
|
|
34
|
+
"@swc/core": "^1.2.125",
|
|
35
35
|
"@types/node": "^17.0.6",
|
|
36
36
|
"rimraf": "^3.0.2",
|
|
37
37
|
"typescript": "next"
|