@ctx-core/graphql-client 7.1.2 → 7.1.3

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ctx-core/graphql-client
2
2
 
3
+ ## 7.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - use fetch instead of safe_fetch
8
+ - use fetch instead of safe_fetch
9
+ - Updated dependencies
10
+ - Updated dependencies
11
+ - @ctx-core/fetch-undici@1.1.0
12
+
3
13
  ## 7.1.2
4
14
 
5
15
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/graphql-client",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "description": "ctx-core graphql-client",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@ctx-core/dom": "^11.1.5",
29
- "@ctx-core/fetch-undici": "^1.0.3",
29
+ "@ctx-core/fetch-undici": "^1.1.0",
30
30
  "@ctx-core/graphql": "^9.0.55",
31
31
  "@ctx-core/object": "^22.0.13"
32
32
  },
@@ -1,4 +1,4 @@
1
- import { safe_fetch as fetch } from '@ctx-core/fetch-undici'
1
+ import { fetch } from '@ctx-core/fetch-undici'
2
2
  import { assign } from '@ctx-core/object'
3
3
  export function graphql_fetch_(in_http_opts = {}) {
4
4
  return async function graphql_fetch(body, fn_in_http_opts = {}) {
@@ -14,11 +14,12 @@ export function graphql_fetch_(in_http_opts = {}) {
14
14
  body
15
15
  }, in_http_opts, fn_in_http_opts))
16
16
  if (!response.ok) {
17
+ const error_text = await response.text()
17
18
  if (process.env.NODE_ENV === 'production') {
18
- console.error(await response.text())
19
+ console.error(error_text)
19
20
  throw `Error fetching graphql`
20
21
  } else {
21
- throw await response.text()
22
+ throw error_text
22
23
  }
23
24
  }
24
25
  const payload = await response.json()