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.
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.