Skip to content

Breaks Apollo query deduplication #106

@martdavidson

Description

@martdavidson

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions