menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

How does apollo-link-dedup work?

October 25, 2020 at 10:04pm

How does apollo-link-dedup work?

October 25, 2020 at 10:04pm (Edited 6 months ago)
I have three child components that each define a query using useQuery. Each of the queries defined in these components have overlap in the fields that they're requesting, and they all have the exact same entrypoint into the schema (and variable). Despite this, it is resulting in 3 different GraphQL queries with all fields defined. I was under the impression that apollo-link-dedup can deduplicate these queries into only the delta of missing information, and use the cache for everything else.

October 31, 2020 at 3:56pm
My understanding my be wrong but I don't think it merges queries. So if you have different attributes requested it won't dedupe them. Assuming the same query is fired from different components it will. Also, its included by default now and you don't need to add the link.
  • reply
  • like