aws / aws/aws-appsync-community

Feature request - Query batching

Open
#31 3 comments 5 reactions 0 assignees View on GitHub
feature-request
Dominant language
HTML
Stars
507
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Hi all 👋

Apollo client provides a very interesting feature for automatically batching queries on the client side. Suppose you have a tree like the following.

``` js
const Child = () => (

[...]

);

const Parent = () => (

[...]

[...]

);
```

By default, the two queries from the `Parent` and the `Child` would generate two separate network requests.

``` graphql
# In the first network request
query Parent {
[...]
}
# In the second network request
query Child {
[...]
}
```

[I read](https://blog.apollographql.com/query-batching-in-apollo-63acfd859862) there is a `shouldBatch` option that you can pass to `ApolloClient` that should solve this issue. I think it would be great to have such feature in Amplify as well.

What do you think?

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files or tests. Start with ApolloClient's shouldBatch behavior and the linked query-batching reference, then trace the corresponding Amplify/AppSync client entry point; done means the Parent and Child queries can be combined instead of sent as two requests, with coverage for that example.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.