evenchange4 / graphql.macro

Compile GraphQL AST at build-time with babel-plugin-macros.
MIT License
239 stars 21 forks source link

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

Open ivoiv opened 4 years ago

ivoiv commented 4 years ago

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.