{"repo":"gajus/graphql-deduplicator","free":true,"listed":false,"github":"https://github.com/gajus/graphql-deduplicator","clone":"git clone https://github.com/gajus/graphql-deduplicator.git","description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","language":"JavaScript","stars":280,"topics":["graphql","apollo","graphql-client","compression"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"graphql-deduplicator A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response. - graphql-deduplicator - Client support - How does it work? - Motivation - Real-life example - Usage - Server-side - Client-side - Example usage with apollo-client - Example usage with apollo-boost - Best practices - Enable compression conditionally - Example using with Apollo Server Client support graphql-deduplicator works with any GraphQL client that appends typename and id fields to every resource. If your client automatically does not request typename and id fields, these fields can be specified in your GraphQL query. graphql-deduplicator has been tested with apollo-client . How does it work? typename and an id values are used to construct a resource identifier. The resource identifier is used to normalize data. As a result, when GraphQL API response contains a resource with a repeating identifier, the apollo-client is going to read only the first instance of the resource and ignore duplicate entities. graphql-deduplicator strips body (fields other than datatype and id ) from all the duplicate entities. Motivation graphql-deduplicator is designed to reduce the GraphQL response size by removing body of duplicate entities. This allows to make queries that return large datasets of repeated data without worrying about the cost of the response body size, time it takes to parse the response or the memory the reconstructed object will consume. Real-life example Consider t","default_branch":null,"files":null,"tree":[],"storefront":"/r/gajus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/gajus/graphql-deduplicator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}