@zeroin.earth/appwrite-graphql 0.14.2 → 0.14.3

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/index.d.mts CHANGED
@@ -5862,11 +5862,11 @@ declare function useUpdateDocument<TDocument>(): {
5862
5862
 
5863
5863
  type Props = {
5864
5864
  functionId: string;
5865
- body?: Record<string, unknown> | undefined;
5866
- async?: boolean | undefined;
5867
- path?: string | undefined;
5868
- method?: string | undefined;
5869
- headers?: object | undefined;
5865
+ body: Record<string, any>;
5866
+ async: boolean;
5867
+ path: string;
5868
+ method: string;
5869
+ headers: Record<string, any>;
5870
5870
  };
5871
5871
  declare function useFunction(): {
5872
5872
  executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
package/dist/index.d.ts CHANGED
@@ -5862,11 +5862,11 @@ declare function useUpdateDocument<TDocument>(): {
5862
5862
 
5863
5863
  type Props = {
5864
5864
  functionId: string;
5865
- body?: Record<string, unknown> | undefined;
5866
- async?: boolean | undefined;
5867
- path?: string | undefined;
5868
- method?: string | undefined;
5869
- headers?: object | undefined;
5865
+ body: Record<string, any>;
5866
+ async: boolean;
5867
+ path: string;
5868
+ method: string;
5869
+ headers: Record<string, any>;
5870
5870
  };
5871
5871
  declare function useFunction(): {
5872
5872
  executeFunction: _tanstack_react_query.UseMutationResult<Record<string, unknown>, Error, Props, unknown>;
package/dist/index.js CHANGED
@@ -429,6 +429,7 @@ function useCreateJWT({ gcTime = 6e5 } = {}) {
429
429
  return data.accountCreateJWT;
430
430
  },
431
431
  onSuccess: (data) => {
432
+ graphql2.client.setJWT(data.jwt);
432
433
  queryClient2.setQueryData(["appwrite", "jwt"], data.jwt, { updatedAt: Date.now() });
433
434
  }
434
435
  });
@@ -446,6 +447,7 @@ function useSuspenseCreateJWT({ gcTime = 6e5 } = {}) {
446
447
  if (errors) {
447
448
  throw errors;
448
449
  }
450
+ graphql2.client.setJWT(data.accountCreateJWT.jwt);
449
451
  return data.accountCreateJWT;
450
452
  }
451
453
  });
@@ -2092,7 +2094,7 @@ function useFunction() {
2092
2094
  const [currentExecution, setCurrentExecution] = (0, import_react5.useState)(null);
2093
2095
  const [currentFunction, setCurrentFunction] = (0, import_react5.useState)(null);
2094
2096
  const executeFunction = useMutation({
2095
- mutationFn: async ({ functionId, body, async, path, method, headers }) => {
2097
+ mutationFn: async ({ functionId, body = {}, async, path, method, headers }) => {
2096
2098
  setCurrentFunction(functionId);
2097
2099
  const { data } = await graphql2.mutation({
2098
2100
  query: createExecution,