graphql.macro icon indicating copy to clipboard operation
graphql.macro copied to clipboard

Infinite loop using loader in component after upgradring @apollo/client from 3.0.2 to 3.1.2

Open ivoiv opened this issue 4 years ago • 0 comments

Referring to my issue here: https://github.com/apollographql/apollo-client/issues/6770

Basically if you load the gql file inside the component where the useQuery hook is used, apollo treats the query as a new query object on reach re-render and makes it fire off the query again, and so on into a loop.

Possible to have in-built memoization for the loaded query? That seems to solve the issue.

ivoiv avatar Aug 04 '20 12:08 ivoiv