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

Add Support for POST APIs with Batch Input in Request Body #3117

Open
amitksingh1490 opened this issue Nov 19, 2024 · 2 comments
Open

Add Support for POST APIs with Batch Input in Request Body #3117

amitksingh1490 opened this issue Nov 19, 2024 · 2 comments
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Comments

@amitksingh1490
Copy link
Collaborator

Description:

Currently, batch URLs can be specified using query parameters for upstream APIs that use GET requests. However, for APIs that support batching via POST requests, the input parameters must be sent as a list in the request body in a specific format. The current system does not support this functionality.

Enhance the system to add the capability to handle such batching via POST APIs

@amitksingh1490 amitksingh1490 added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Nov 19, 2024
@amitksingh1490
Copy link
Collaborator Author

Proposal

if upstream takes body as

[{"key": "id", "value": 1}, {"key": "id", "value": 2}]
type Post {
  id: Int!
  userId: Int!
  title: String!
  body: String!
  user: User
    @http(
      url: "http://jsonplaceholder.typicode.com/users"
      body: [{key: "id", value: "{{.value.userId}}"}]
      batchKey: ["id"]
    )
}

if upstream takes body as

[{"id": 1}, {"id": 2}]
type Post {
  id: Int!
  userId: Int!
  title: String!
  body: String!
  user: User
    @http(
      url: "http://jsonplaceholder.typicode.com/users"
      body: [{id: "{{.value.userId}}"}]
      batchKey: ["id"]
    )
}

if upstream takes body as

[1,2]
type Post {
  id: Int!
  userId: Int!
  title: String!
  body: String!
  user: User
    @http(
      url: "http://jsonplaceholder.typicode.com/users"
      body: ["{{.value.userId}}"]
      batchKey: ["id"]
    )
}

@meskill
Copy link
Contributor

meskill commented Dec 13, 2024

@amitksingh1490 is the issue resolved by #3140 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
None yet
Development

No branches or pull requests

2 participants