Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Batching Client GraphQL Queries #149

Closed
koenpunt opened this issue Sep 23, 2021 · 2 comments
Closed

Feature request: Batching Client GraphQL Queries #149

koenpunt opened this issue Sep 23, 2021 · 2 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@koenpunt
Copy link
Contributor

koenpunt commented Sep 23, 2021

A lot of graphql server implementations have support for batch requests.

A batch request is a request with an array of graphql spec objects as body, it would look something like this;

[
  {
    "query": "query FirstQuery { ... }",
    "variables": {}
  },
  {
    "query": "query SecondQuery { ... }",
    "variables": {}
  }
]

And the response would be;

[
  {
    "data": { ... },
    "errors": null
  },
  {
    "data": null,
    "errors": [ ... ]
  }
]

Queries would be executed sequentially, so if the first is a mutation, the second will work with the updated data of the first.

Batching is described in full in this article on the apollo website: https://www.apollographql.com/blog/apollo-client/performance/batching-client-graphql-queries/

I could work on this if this is something you would like to see in the library.

@koenpunt koenpunt changed the title Feature: batch requests Feature: Batching Client GraphQL Queries Sep 23, 2021
@koenpunt koenpunt changed the title Feature: Batching Client GraphQL Queries Feature request: Batching Client GraphQL Queries Sep 23, 2021
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 23, 2021
@koenpunt
Copy link
Contributor Author

Related: #108

@bclozel
Copy link
Member

bclozel commented Sep 30, 2021

We've discussed this issue and we're siding with the GraphQL Java team here: there's nothing in the spec for this right now. Also, even if we meant to support it anyway, we would only do so on the client side as we can't implement it on the server side.

I'm closing this issue for now, to be re-evaluated if the GraphQL Java issue is reconsidered.

@bclozel bclozel closed this as completed Sep 30, 2021
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants