Skip to content

useSuspenseQuery polling #13113

@sophstad

Description

@sophstad

Issue Description

Based on its documentation and typing, useSuspenseQuery lacks support for polling via pollInterval. However, it actually works! Seems like this is because the hook makes a call to watchQuery with whatever options are specified. We'd love to keep using this, along with nextFetchPolicy, which hits the same issue. Is there any reason not to offer official support?

My reproduction includes a call to useSuspenseQuery with a pollInterval set, which yields a type error. The query resolver logs each time it is called, so you can observe polling in the browser console.

P.S. Would be awesome to offer a TypeScript-ready CodeSandbox template!

Link to Reproduction

https://codesandbox.io/p/devbox/eloquent-wescoff-k44smw?workspaceId=ws_8rvGwpeFUisRWig4LxWzQN

Reproduction Steps

No response

@apollo/client version

4.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions