naystack 1.5.5 → 1.5.7
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/dist/graphql/client.cjs.js +3 -2
- package/dist/graphql/client.d.mts +1 -1
- package/dist/graphql/client.d.ts +1 -1
- package/dist/graphql/client.esm.js +3 -2
- package/dist/graphql/index.cjs.js +0 -2
- package/dist/graphql/index.esm.js +0 -2
- package/dist/graphql/utils.cjs.js +0 -3
- package/dist/graphql/utils.esm.js +0 -3
- package/package.json +1 -1
|
@@ -130,8 +130,9 @@ function useAuthQuery(query, variables) {
|
|
|
130
130
|
}
|
|
131
131
|
}, [fetch, token, variables, calledVars]);
|
|
132
132
|
const reFetch = (0, import_react.useCallback)(
|
|
133
|
-
(
|
|
134
|
-
|
|
133
|
+
(input) => fetch({
|
|
134
|
+
// @ts-expect-error -- to allow dynamic props
|
|
135
|
+
variables: { input },
|
|
135
136
|
context: tokenContext(token),
|
|
136
137
|
fetchPolicy: "no-cache"
|
|
137
138
|
}),
|
|
@@ -12,7 +12,7 @@ declare const tokenContext: (token?: string | null) => {
|
|
|
12
12
|
};
|
|
13
13
|
credentials: string;
|
|
14
14
|
} | undefined;
|
|
15
|
-
declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V): readonly [(
|
|
15
|
+
declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V): readonly [(input: V["input"]) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
|
|
16
16
|
declare function useAuthMutation<T, V extends OperationVariables>(mutation: TypedDocumentNode<T, V>, options?: MutationHookOptions<T, V>): readonly [(input: V["input"]) => Promise<_apollo_client.FetchResult<T>>, _apollo_client.MutationResult<T>];
|
|
17
17
|
|
|
18
18
|
export { ApolloWrapper, tokenContext, useAuthMutation, useAuthQuery };
|
package/dist/graphql/client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const tokenContext: (token?: string | null) => {
|
|
|
12
12
|
};
|
|
13
13
|
credentials: string;
|
|
14
14
|
} | undefined;
|
|
15
|
-
declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V): readonly [(
|
|
15
|
+
declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V): readonly [(input: V["input"]) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
|
|
16
16
|
declare function useAuthMutation<T, V extends OperationVariables>(mutation: TypedDocumentNode<T, V>, options?: MutationHookOptions<T, V>): readonly [(input: V["input"]) => Promise<_apollo_client.FetchResult<T>>, _apollo_client.MutationResult<T>];
|
|
17
17
|
|
|
18
18
|
export { ApolloWrapper, tokenContext, useAuthMutation, useAuthQuery };
|
|
@@ -106,8 +106,9 @@ function useAuthQuery(query, variables) {
|
|
|
106
106
|
}
|
|
107
107
|
}, [fetch, token, variables, calledVars]);
|
|
108
108
|
const reFetch = useCallback(
|
|
109
|
-
(
|
|
110
|
-
|
|
109
|
+
(input) => fetch({
|
|
110
|
+
// @ts-expect-error -- to allow dynamic props
|
|
111
|
+
variables: { input },
|
|
111
112
|
context: tokenContext(token),
|
|
112
113
|
fetchPolicy: "no-cache"
|
|
113
114
|
}),
|
|
@@ -735,7 +735,6 @@ var getUserId = async () => {
|
|
|
735
735
|
function getAuthCaller(fn) {
|
|
736
736
|
return (0, import_react.cache)(
|
|
737
737
|
async (data) => {
|
|
738
|
-
"use server";
|
|
739
738
|
const ctx = {
|
|
740
739
|
userId: await getUserId(),
|
|
741
740
|
isRefreshID: true
|
|
@@ -747,7 +746,6 @@ function getAuthCaller(fn) {
|
|
|
747
746
|
function getCaller(fn) {
|
|
748
747
|
return (0, import_react.cache)(
|
|
749
748
|
async (data) => {
|
|
750
|
-
"use server";
|
|
751
749
|
const ctx = {
|
|
752
750
|
userId: null,
|
|
753
751
|
isRefreshID: true
|
|
@@ -731,7 +731,6 @@ var getUserId = async () => {
|
|
|
731
731
|
function getAuthCaller(fn) {
|
|
732
732
|
return cache(
|
|
733
733
|
async (data) => {
|
|
734
|
-
"use server";
|
|
735
734
|
const ctx = {
|
|
736
735
|
userId: await getUserId(),
|
|
737
736
|
isRefreshID: true
|
|
@@ -743,7 +742,6 @@ function getAuthCaller(fn) {
|
|
|
743
742
|
function getCaller(fn) {
|
|
744
743
|
return cache(
|
|
745
744
|
async (data) => {
|
|
746
|
-
"use server";
|
|
747
745
|
const ctx = {
|
|
748
746
|
userId: null,
|
|
749
747
|
isRefreshID: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
"server-only";
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -129,7 +128,6 @@ var getUserId = async () => {
|
|
|
129
128
|
function getAuthCaller(fn) {
|
|
130
129
|
return (0, import_react.cache)(
|
|
131
130
|
async (data) => {
|
|
132
|
-
"use server";
|
|
133
131
|
const ctx = {
|
|
134
132
|
userId: await getUserId(),
|
|
135
133
|
isRefreshID: true
|
|
@@ -141,7 +139,6 @@ function getAuthCaller(fn) {
|
|
|
141
139
|
function getCaller(fn) {
|
|
142
140
|
return (0, import_react.cache)(
|
|
143
141
|
async (data) => {
|
|
144
|
-
"use server";
|
|
145
142
|
const ctx = {
|
|
146
143
|
userId: null,
|
|
147
144
|
isRefreshID: true
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"server-only";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -114,7 +113,6 @@ var getUserId = async () => {
|
|
|
114
113
|
function getAuthCaller(fn) {
|
|
115
114
|
return cache(
|
|
116
115
|
async (data) => {
|
|
117
|
-
"use server";
|
|
118
116
|
const ctx = {
|
|
119
117
|
userId: await getUserId(),
|
|
120
118
|
isRefreshID: true
|
|
@@ -126,7 +124,6 @@ function getAuthCaller(fn) {
|
|
|
126
124
|
function getCaller(fn) {
|
|
127
125
|
return cache(
|
|
128
126
|
async (data) => {
|
|
129
|
-
"use server";
|
|
130
127
|
const ctx = {
|
|
131
128
|
userId: null,
|
|
132
129
|
isRefreshID: true
|