Issue
Using either loader or gql from this package breaks apollo-client's query deduplication.
Steps to Recreate
In two different components, fire the exact same query by either importing the same .graphql file with loader, or defining the same query with gql from this package. Render both components together, and you will see two network requests fire.
Expectation
If you do the same as the above but with gql from the graphql-tag package, Apollo recognizes that the two queries are the same, and only fires one network request. Could be related to apollographql/apollo-client#4930
Queries are deduplicated only according to the object reference of the DocumentNode.
I imagine this package is returning a different DocumentNode every time the query is imported / defined rather than building up a cache of already-compiled queries and check against that.
Is caching something that's in scope for this package?
Issue
Using either loader or gql from this package breaks apollo-client's query deduplication.
Steps to Recreate
In two different components, fire the exact same query by either importing the same .graphql file with
loader, or defining the same query withgqlfrom this package. Render both components together, and you will see two network requests fire.Expectation
If you do the same as the above but with
gqlfrom thegraphql-tagpackage, Apollo recognizes that the two queries are the same, and only fires one network request. Could be related to apollographql/apollo-client#4930Queries are deduplicated only according to the object reference of the DocumentNode.I imagine this package is returning a different DocumentNode every time the query is imported / defined rather than building up a cache of already-compiled queries and check against that.
Is caching something that's in scope for this package?