@zeroin.earth/appwrite-graphql 0.14.2 → 0.14.4

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.mjs CHANGED
@@ -356,6 +356,7 @@ function useCreateJWT({ gcTime = 6e5 } = {}) {
356
356
  return data.accountCreateJWT;
357
357
  },
358
358
  onSuccess: (data) => {
359
+ graphql2.client.setJWT(data.jwt);
359
360
  queryClient2.setQueryData(["appwrite", "jwt"], data.jwt, { updatedAt: Date.now() });
360
361
  }
361
362
  });
@@ -373,6 +374,7 @@ function useSuspenseCreateJWT({ gcTime = 6e5 } = {}) {
373
374
  if (errors) {
374
375
  throw errors;
375
376
  }
377
+ graphql2.client.setJWT(data.accountCreateJWT.jwt);
376
378
  return data.accountCreateJWT;
377
379
  }
378
380
  });
@@ -2019,7 +2021,14 @@ function useFunction() {
2019
2021
  const [currentExecution, setCurrentExecution] = useState(null);
2020
2022
  const [currentFunction, setCurrentFunction] = useState(null);
2021
2023
  const executeFunction = useMutation({
2022
- mutationFn: async ({ functionId, body, async, path, method, headers }) => {
2024
+ mutationFn: async ({
2025
+ functionId,
2026
+ body = {},
2027
+ async = false,
2028
+ path = "/",
2029
+ method = "POST",
2030
+ headers = {}
2031
+ }) => {
2023
2032
  setCurrentFunction(functionId);
2024
2033
  const { data } = await graphql2.mutation({
2025
2034
  query: createExecution,