Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component does not update if the query is "fast". #287

Closed
kptlronyttcna opened this issue Jun 10, 2019 · 3 comments · Fixed by #296
Closed

Component does not update if the query is "fast". #287

kptlronyttcna opened this issue Jun 10, 2019 · 3 comments · Fixed by #296

Comments

@kptlronyttcna
Copy link

I'm trying graphql with a local server, so results come pretty fast. But apparently the component wont re-render when result of the query returns quickly.

const query = `
    query ASDF {
        tracks {
            name
        }
    }
`

export const UrqlUser: React.FC = () => {
    const [res] = useQuery({
        query: query,
    })
    if (res.fetching) return <div>Fetching ...</div>
    if (res.error) return <div>Error ...</div>
    return <div>{JSON.stringify(res.data)}</div>
}

I tried to render UrqlUser but it gets stuck on Fetching..., but if I use chrome network throttling, it works fine. I've tested several different throttling settings, any delay below 50ms is problematic. Sometimes it gets stuck on fetching and sometimes it doesn't, but the lower the delay the more it gets stuck.

@HusseinMorsy
Copy link

HusseinMorsy commented Jun 10, 2019

I have the same problem (urql version 1.1.1)

@JoviDeCroock
Copy link
Collaborator

JoviDeCroock commented Jun 12, 2019

I have tried reproducing this in the examples folder as well as in a test and can't seem to get this to work. Could you provide a repo/codesandbox where we can see the problem?

@kptlronyttcna
Copy link
Author

Here

You can configure the delay in fetch.ts#98.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants