@akanjs/signal 1.0.7 → 1.0.8

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.
@@ -167,7 +167,7 @@ const serviceFetchOf = (signal) => {
167
167
  ),
168
168
  fetchPolicy
169
169
  ))[name];
170
- const data = resolve ? crystalize(res) : res;
170
+ const data = resolve && res !== null ? crystalize(res) : res;
171
171
  import_common.Logger.debug(`fetch: ${key} end: ${(0, import_base.dayjs)().format("YYYY-MM-DD HH:mm:ss.SSS")} ${Date.now() - now}ms`);
172
172
  return data;
173
173
  } catch (e) {
package/cjs/src/gql.js CHANGED
@@ -27,6 +27,7 @@ __export(gql_exports, {
27
27
  setGqlOnStorage: () => setGqlOnStorage
28
28
  });
29
29
  module.exports = __toCommonJS(gql_exports);
30
+ var import_common = require("@akanjs/common");
30
31
  class GqlStorage {
31
32
  }
32
33
  const getGqlOnStorage = (refName) => {
@@ -57,6 +58,7 @@ const query = async (fetchClient, query2, variables = {}, option = {}) => {
57
58
  }
58
59
  }).toPromise();
59
60
  if (!data) {
61
+ import_common.Logger.rawLog(error, void 0, "error");
60
62
  const content = error?.graphQLErrors[0]?.message ?? "Unknown Error";
61
63
  if (option.onError) {
62
64
  option.onError(content);
@@ -82,6 +84,7 @@ const mutate = async (fetchClient, mutation, variables = {}, option = {}) => {
82
84
  }
83
85
  }).toPromise();
84
86
  if (!data) {
87
+ import_common.Logger.rawLog(error, void 0, "error");
85
88
  const content = error?.graphQLErrors[0]?.message ?? "Unknown Error";
86
89
  if (option.onError) {
87
90
  option.onError(content);
@@ -144,7 +144,7 @@ const serviceFetchOf = (signal) => {
144
144
  ),
145
145
  fetchPolicy
146
146
  ))[name];
147
- const data = resolve ? crystalize(res) : res;
147
+ const data = resolve && res !== null ? crystalize(res) : res;
148
148
  Logger.debug(`fetch: ${key} end: ${dayjs().format("YYYY-MM-DD HH:mm:ss.SSS")} ${Date.now() - now}ms`);
149
149
  return data;
150
150
  } catch (e) {
package/esm/src/gql.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { Logger } from "@akanjs/common";
1
2
  class GqlStorage {
2
3
  }
3
4
  const getGqlOnStorage = (refName) => {
@@ -28,6 +29,7 @@ const query = async (fetchClient, query2, variables = {}, option = {}) => {
28
29
  }
29
30
  }).toPromise();
30
31
  if (!data) {
32
+ Logger.rawLog(error, void 0, "error");
31
33
  const content = error?.graphQLErrors[0]?.message ?? "Unknown Error";
32
34
  if (option.onError) {
33
35
  option.onError(content);
@@ -53,6 +55,7 @@ const mutate = async (fetchClient, mutation, variables = {}, option = {}) => {
53
55
  }
54
56
  }).toPromise();
55
57
  if (!data) {
58
+ Logger.rawLog(error, void 0, "error");
56
59
  const content = error?.graphQLErrors[0]?.message ?? "Unknown Error";
57
60
  if (option.onError) {
58
61
  option.onError(content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/signal",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"