@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.
@@ -3388,8 +3388,8 @@ var GAME_FIELDS_FRAGMENT = import_client55.gql`
3388
3388
  ${OWNER_FIELDS_FRAGMENT}
3389
3389
  `;
3390
3390
  var GET_GAMES = import_client55.gql`
3391
- query getGames($userId: ID) {
3392
- games(userId: $userId) {
3391
+ query getGames {
3392
+ games {
3393
3393
  ...GameFields
3394
3394
  }
3395
3395
  }
@@ -3653,9 +3653,7 @@ var START_GAME_MUTATION = import_client64.gql`
3653
3653
  `;
3654
3654
  var LEAVE_GAME_MUTATION = import_client64.gql`
3655
3655
  mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
3656
- leaveGame(_id: $_id, gameType: $gameType) {
3657
- userId
3658
- }
3656
+ leaveGame(_id: $_id, gameType: $gameType)
3659
3657
  }
3660
3658
  `;
3661
3659
 
@@ -3680,27 +3678,20 @@ var useStartGame = () => {
3680
3678
  var useLeaveGame = () => {
3681
3679
  const [leaveGame, { loading, error }] = (0, import_client65.useMutation)(LEAVE_GAME_MUTATION, {
3682
3680
  awaitRefetchQueries: true,
3683
- refetchQueries: (mutationResult) => {
3684
- const userId = mutationResult?.data?.leaveGame?.userId;
3685
- if (!userId) return [];
3686
- return [
3687
- {
3688
- query: GET_GAMES,
3689
- variables: { userId }
3690
- // Pass the userId for refetching
3691
- }
3692
- ];
3693
- }
3681
+ refetchQueries: [
3682
+ {
3683
+ query: GET_GAMES
3684
+ }
3685
+ ]
3694
3686
  });
3695
3687
  return { error, leaveGame, loading };
3696
3688
  };
3697
3689
 
3698
3690
  // src/graphql/hooks/game/hooksQuery.ts
3699
3691
  var import_client66 = require("@apollo/client");
3700
- var useGetGames = (userId) => {
3692
+ var useGetGames = () => {
3701
3693
  const { loading, error, data, refetch } = (0, import_client66.useQuery)(GET_GAMES, {
3702
- fetchPolicy: "network-only",
3703
- variables: { userId }
3694
+ fetchPolicy: "network-only"
3704
3695
  });
3705
3696
  const games = data?.games || [];
3706
3697
  return { error, games, loading, refetch };