@timardex/cluemart-shared 1.4.96 → 1.4.97

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.
@@ -3238,8 +3238,8 @@ var GAME_FIELDS_FRAGMENT = gql29`
3238
3238
  ${OWNER_FIELDS_FRAGMENT}
3239
3239
  `;
3240
3240
  var GET_GAMES = gql29`
3241
- query getGames($userId: ID) {
3242
- games(userId: $userId) {
3241
+ query getGames {
3242
+ games {
3243
3243
  ...GameFields
3244
3244
  }
3245
3245
  }
@@ -3503,9 +3503,7 @@ var START_GAME_MUTATION = gql34`
3503
3503
  `;
3504
3504
  var LEAVE_GAME_MUTATION = gql34`
3505
3505
  mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
3506
- leaveGame(_id: $_id, gameType: $gameType) {
3507
- userId
3508
- }
3506
+ leaveGame(_id: $_id, gameType: $gameType)
3509
3507
  }
3510
3508
  `;
3511
3509
 
@@ -3530,27 +3528,20 @@ var useStartGame = () => {
3530
3528
  var useLeaveGame = () => {
3531
3529
  const [leaveGame, { loading, error }] = useMutation18(LEAVE_GAME_MUTATION, {
3532
3530
  awaitRefetchQueries: true,
3533
- refetchQueries: (mutationResult) => {
3534
- const userId = mutationResult?.data?.leaveGame?.userId;
3535
- if (!userId) return [];
3536
- return [
3537
- {
3538
- query: GET_GAMES,
3539
- variables: { userId }
3540
- // Pass the userId for refetching
3541
- }
3542
- ];
3543
- }
3531
+ refetchQueries: [
3532
+ {
3533
+ query: GET_GAMES
3534
+ }
3535
+ ]
3544
3536
  });
3545
3537
  return { error, leaveGame, loading };
3546
3538
  };
3547
3539
 
3548
3540
  // src/graphql/hooks/game/hooksQuery.ts
3549
3541
  import { useQuery as useQuery13 } from "@apollo/client";
3550
- var useGetGames = (userId) => {
3542
+ var useGetGames = () => {
3551
3543
  const { loading, error, data, refetch } = useQuery13(GET_GAMES, {
3552
- fetchPolicy: "network-only",
3553
- variables: { userId }
3544
+ fetchPolicy: "network-only"
3554
3545
  });
3555
3546
  const games = data?.games || [];
3556
3547
  return { error, games, loading, refetch };
@@ -3692,4 +3683,4 @@ export {
3692
3683
  useGetGames,
3693
3684
  useGetGame
3694
3685
  };
3695
- //# sourceMappingURL=chunk-DMP4JF4Q.mjs.map
3686
+ //# sourceMappingURL=chunk-4VZXLFSL.mjs.map