naystack 1.5.6 → 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.
@@ -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
- (v) => fetch({
134
- variables: v,
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 [(v?: V) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
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 };
@@ -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 [(v?: V) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
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
- (v) => fetch({
110
- variables: v,
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
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
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",