api-platform / api-platform/core

[GraphQL] Batch requests in Apollo format

Đang mở
#3,280 4 bình luận 6 reaction 0 người được giao Xem trên GitHub
GraphQL
Ngôn ngữ chính
PHP
Star
2.6k
Fork
980
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
48

Mô tả

**Description**
This Apollo extension allow us to send multiple request at the same time:
https://www.apollographql.com/docs/link/links/batch-http/
It will be a good feature to have since we don't support sub class mutation( because of[ Input union](https://github.com/graphql/graphql-spec/blob/master/rfcs/InputUnion.md) spec) and it force client to send several requests for one action.I think this plugin solve some part of performance issue.
Here is Apollo client Article:
https://blog.apollographql.com/query-batching-in-apollo-63acfd859862

This plugin changes the requests to this format:
```
[
{
query: < query 0 >,
variables: < variables for query 0 >,
},
{
query: < query 1 >,
variables: < variables for query 1 >,
},
{
query: < query n >
variables: < variables for query n >,
}
]
```

I think we have two option to implement this part:
* Using [`StandardServer`](https://webonyx.github.io/graphql-php/exeuting-queries/#using-server)
This is good but we need to rewrite request process and remove the current GraphQl executor and replace it with `StandardServer`. Because `StandardServer` don't support the file upload we need to process the requests just like before.

* Calling executor several times.
This is the easiest option for implementation.

I wanted to create a pull request for this, I thought its better to talk about it first.

What do you think?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.