naystack 1.6.0 → 1.6.1

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.
@@ -117,7 +117,9 @@ var tokenContext = (token) => {
117
117
  };
118
118
  function useAuthQuery(query, variables) {
119
119
  const token = (0, import_client2.useToken)();
120
- const [fetch, result] = (0, import_client.useLazyQuery)(query);
120
+ const [fetch, result] = (0, import_client.useLazyQuery)(query, {
121
+ fetchPolicy: "no-cache"
122
+ });
121
123
  const prevVarsRef = (0, import_react.useRef)(null);
122
124
  (0, import_react.useEffect)(() => {
123
125
  const serialized = JSON.stringify(variables);
@@ -126,8 +128,7 @@ function useAuthQuery(query, variables) {
126
128
  void fetch({
127
129
  // @ts-expect-error -- to allow dynamic props
128
130
  variables: { input: variables },
129
- context: tokenContext(token),
130
- fetchPolicy: "no-cache"
131
+ context: tokenContext(token)
131
132
  });
132
133
  }
133
134
  }, [fetch, token, variables]);
@@ -135,8 +136,7 @@ function useAuthQuery(query, variables) {
135
136
  (input) => fetch({
136
137
  // @ts-expect-error -- to allow dynamic props
137
138
  variables: { input },
138
- context: tokenContext(token),
139
- fetchPolicy: "no-cache"
139
+ context: tokenContext(token)
140
140
  }),
141
141
  [fetch, token]
142
142
  );
@@ -92,7 +92,9 @@ var tokenContext = (token) => {
92
92
  };
93
93
  function useAuthQuery(query, variables) {
94
94
  const token = useToken();
95
- const [fetch, result] = useLazyQuery(query);
95
+ const [fetch, result] = useLazyQuery(query, {
96
+ fetchPolicy: "no-cache"
97
+ });
96
98
  const prevVarsRef = useRef(null);
97
99
  useEffect(() => {
98
100
  const serialized = JSON.stringify(variables);
@@ -101,8 +103,7 @@ function useAuthQuery(query, variables) {
101
103
  void fetch({
102
104
  // @ts-expect-error -- to allow dynamic props
103
105
  variables: { input: variables },
104
- context: tokenContext(token),
105
- fetchPolicy: "no-cache"
106
+ context: tokenContext(token)
106
107
  });
107
108
  }
108
109
  }, [fetch, token, variables]);
@@ -110,8 +111,7 @@ function useAuthQuery(query, variables) {
110
111
  (input) => fetch({
111
112
  // @ts-expect-error -- to allow dynamic props
112
113
  variables: { input },
113
- context: tokenContext(token),
114
- fetchPolicy: "no-cache"
114
+ context: tokenContext(token)
115
115
  }),
116
116
  [fetch, token]
117
117
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",