Skip to content

Commit

Permalink
Throw when calling execute in a non-browser environment
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Feb 13, 2025
1 parent de7f290 commit a1c67b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/react/hooks/useLazyQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ export function useLazyQuery<
"useLazyQuery: 'execute' should not be called during render. To start a query during render, use the 'useQuery' hook."
);

invariant(
typeof window !== "undefined",
"useLazyQuery does not support SSR"
);

const [executeOptions] = args;

const options: Partial<WatchQueryOptions<TVariables, TData>> = {
Expand Down

0 comments on commit a1c67b4

Please sign in to comment.