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

Apollo client ios support query batching/merging? #3088

Closed
ArunVicky001 opened this issue Jun 22, 2023 · 1 comment
Closed

Apollo client ios support query batching/merging? #3088

ArunVicky001 opened this issue Jun 22, 2023 · 1 comment
Labels
question Issues that have a question which should be addressed

Comments

@ArunVicky001
Copy link

Question

I am using apollo client 1.2.0 version. I want execute multiple query in parallel. is it possible in this version?

example

import Apollo

let apolloClient = ApolloClient(url: URL(string: "https://api.graphql.org/"))

let query1 = """
query {
  viewer {
    name
  }
}
"""

let query2 = """
query {
  repository(owner: "apollographql", name: "apollo-client") {
    name
  }
}
"""

let batchQuery = BatchQuery([query1, query2])

apolloClient.send(batchQuery) { result in
  switch result {
  case .success(let data):
    print(data.data?.viewer?.name)
    print(data.data?.repository?.name)
  case .failure(let error):
    print(error)
  }
}
@ArunVicky001 ArunVicky001 added the question Issues that have a question which should be addressed label Jun 22, 2023
@calvincestari
Copy link
Member

@ArunVicky001 please don't open a new issue for the same request. I'll respond in the older issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that have a question which should be addressed
Projects
None yet
Development

No branches or pull requests

2 participants