@timardex/cluemart-shared 1.4.97 → 1.4.98

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.
@@ -3506,6 +3506,14 @@ var LEAVE_GAME_MUTATION = gql34`
3506
3506
  leaveGame(_id: $_id, gameType: $gameType)
3507
3507
  }
3508
3508
  `;
3509
+ var UPDATE_DAILY_CLUE_MUTATION = gql34`
3510
+ mutation updateDailyClueGame($_id: ID!, $foundLetter: String!) {
3511
+ updateDailyClueGame(_id: $_id, foundLetter: $foundLetter) {
3512
+ ...GameFields
3513
+ }
3514
+ }
3515
+ ${GAME_FIELDS_FRAGMENT}
3516
+ `;
3509
3517
 
3510
3518
  // src/graphql/hooks/game/hooksMutation.ts
3511
3519
  var useStartGame = () => {
@@ -3513,12 +3521,18 @@ var useStartGame = () => {
3513
3521
  awaitRefetchQueries: true,
3514
3522
  refetchQueries: (mutationResult) => {
3515
3523
  const gameId = mutationResult?.data?.startGame?._id;
3516
- if (!gameId) return [];
3524
+ const userId = mutationResult?.data?.startGame?.owner?.userId;
3525
+ if (!gameId || !userId) return [];
3517
3526
  return [
3518
3527
  {
3519
3528
  query: GET_GAME,
3520
3529
  variables: { _id: gameId }
3521
3530
  // Pass the gameId for refetching
3531
+ },
3532
+ {
3533
+ query: GET_USER,
3534
+ variables: { _id: userId }
3535
+ // Pass the userId for refetching
3522
3536
  }
3523
3537
  ];
3524
3538
  }
@@ -3536,6 +3550,23 @@ var useLeaveGame = () => {
3536
3550
  });
3537
3551
  return { error, leaveGame, loading };
3538
3552
  };
3553
+ var useUpdateDailyClueGame = () => {
3554
+ const [updateDailyClueGame, { loading, error }] = useMutation18(UPDATE_DAILY_CLUE_MUTATION, {
3555
+ awaitRefetchQueries: true,
3556
+ refetchQueries: (mutationResult) => {
3557
+ const gameId = mutationResult?.data?.updateDailyClueGame?._id;
3558
+ if (!gameId) return [];
3559
+ return [
3560
+ {
3561
+ query: GET_GAME,
3562
+ variables: { _id: gameId }
3563
+ // Pass the gameId for refetching
3564
+ }
3565
+ ];
3566
+ }
3567
+ });
3568
+ return { error, loading, updateDailyClueGame };
3569
+ };
3539
3570
 
3540
3571
  // src/graphql/hooks/game/hooksQuery.ts
3541
3572
  import { useQuery as useQuery13 } from "@apollo/client";
@@ -3680,7 +3711,8 @@ export {
3680
3711
  useGetAppSettings,
3681
3712
  useStartGame,
3682
3713
  useLeaveGame,
3714
+ useUpdateDailyClueGame,
3683
3715
  useGetGames,
3684
3716
  useGetGame
3685
3717
  };
3686
- //# sourceMappingURL=chunk-4VZXLFSL.mjs.map
3718
+ //# sourceMappingURL=chunk-STGIPJMO.mjs.map