apollographql/apollo-link

Feature idea • Merging queries while being batched if using same query

Open

#325 opened on Dec 10, 2017

View on GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (335 forks)auto 404
enhancementhelp wantedquestion

Repository metrics

Stars
 (1,427 stars)
PR merge metrics
 (PR metrics pending)

Description

Problem

I have a repetitive subscription witch leads to a repetitive query (if I'm not mistaken, since I need the QueryRef to execute the subscription QueryRef.subscribeToMore).

Finding solution

So I implemented apollo-link-batch-http in order to avoid 20 queries and it works great. But it's doing the same query with only uuid changing.

I thought that dataloader could help me out but it did not since they are separated queries (even if they are done in one call).

That 's why I thought that maybe it could be something that apollo-link-batch-http could to itself (or maybe another package like apollo-link-batch-merge-http).

It could merge queries that are using the same query.

What do you think?

Contributor guide