naystack 1.5.16 → 1.5.17

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.
@@ -123,16 +123,17 @@ function useAuthQuery(query, variables) {
123
123
  if (token && variables && calledVars !== JSON.stringify(variables)) {
124
124
  setCalledVars(JSON.stringify(variables));
125
125
  void fetch({
126
- variables,
126
+ // @ts-expect-error -- to allow dynamic props
127
+ variables: { input },
127
128
  context: tokenContext(token),
128
129
  fetchPolicy: "no-cache"
129
130
  });
130
131
  }
131
132
  }, [fetch, token, variables, calledVars]);
132
133
  const reFetch = (0, import_react.useCallback)(
133
- (input) => fetch({
134
+ (input2) => fetch({
134
135
  // @ts-expect-error -- to allow dynamic props
135
- variables: { input },
136
+ variables: { input: input2 },
136
137
  context: tokenContext(token),
137
138
  fetchPolicy: "no-cache"
138
139
  }),
@@ -144,9 +145,9 @@ function useAuthMutation(mutation, options) {
144
145
  const token = (0, import_client2.useToken)();
145
146
  const [mutate, result] = (0, import_client.useMutation)(mutation, options);
146
147
  const method = (0, import_react.useCallback)(
147
- (input) => mutate({
148
+ (input2) => mutate({
148
149
  // @ts-expect-error -- to allow dynamic props
149
- variables: { input },
150
+ variables: { input: input2 },
150
151
  context: tokenContext(token)
151
152
  }),
152
153
  [token]
@@ -90,7 +90,7 @@ declare const tokenContext: (token?: string | null) => {
90
90
  *
91
91
  * @category GraphQL
92
92
  */
93
- 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>];
93
+ declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V["input"]): readonly [(input?: V["input"]) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
94
94
  /**
95
95
  * Hook to run a GraphQL mutation with the current user's token. Returns a function you call with the mutation input.
96
96
  *
@@ -126,6 +126,6 @@ declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocum
126
126
  *
127
127
  * @category GraphQL
128
128
  */
129
- 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>];
129
+ 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>];
130
130
 
131
131
  export { ApolloWrapper, tokenContext, useAuthMutation, useAuthQuery };
@@ -90,7 +90,7 @@ declare const tokenContext: (token?: string | null) => {
90
90
  *
91
91
  * @category GraphQL
92
92
  */
93
- 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>];
93
+ declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocumentNode<T, V>, variables?: V["input"]): readonly [(input?: V["input"]) => Promise<_apollo_client.QueryResult<T, V>>, _apollo_client.QueryResult<T, V>];
94
94
  /**
95
95
  * Hook to run a GraphQL mutation with the current user's token. Returns a function you call with the mutation input.
96
96
  *
@@ -126,6 +126,6 @@ declare function useAuthQuery<T, V extends OperationVariables>(query: TypedDocum
126
126
  *
127
127
  * @category GraphQL
128
128
  */
129
- 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>];
129
+ 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>];
130
130
 
131
131
  export { ApolloWrapper, tokenContext, useAuthMutation, useAuthQuery };
@@ -99,16 +99,17 @@ function useAuthQuery(query, variables) {
99
99
  if (token && variables && calledVars !== JSON.stringify(variables)) {
100
100
  setCalledVars(JSON.stringify(variables));
101
101
  void fetch({
102
- variables,
102
+ // @ts-expect-error -- to allow dynamic props
103
+ variables: { input },
103
104
  context: tokenContext(token),
104
105
  fetchPolicy: "no-cache"
105
106
  });
106
107
  }
107
108
  }, [fetch, token, variables, calledVars]);
108
109
  const reFetch = useCallback(
109
- (input) => fetch({
110
+ (input2) => fetch({
110
111
  // @ts-expect-error -- to allow dynamic props
111
- variables: { input },
112
+ variables: { input: input2 },
112
113
  context: tokenContext(token),
113
114
  fetchPolicy: "no-cache"
114
115
  }),
@@ -120,9 +121,9 @@ function useAuthMutation(mutation, options) {
120
121
  const token = useToken();
121
122
  const [mutate, result] = useMutation(mutation, options);
122
123
  const method = useCallback(
123
- (input) => mutate({
124
+ (input2) => mutate({
124
125
  // @ts-expect-error -- to allow dynamic props
125
- variables: { input },
126
+ variables: { input: input2 },
126
127
  context: tokenContext(token)
127
128
  }),
128
129
  [token]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.5.16",
3
+ "version": "1.5.17",
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",