
A powerful Java library for aggregating and executing GraphQL operations from multiple microservices using a single unified schema.

[Builds](https://circleci.com/gh/graph-quilt/graphql-orchestrator-java)
### Introduction
**graphql-orchestrator-java** simplifies the process of accessing data from various GraphQL microservices by providing a unified GraphQL schema.
This enables you to query multiple microservices through a single endpoint, reducing complexity and improving performance.
The library supports two strategies to aggregate and combine the schemas from multiple microservices
* Schema Stitching with [a recursive strategy](https://graph-quilt.github.io/docs/merging-types/)
* [Apollo Federation Style](https://netflix.github.io/dgs/federation/) Schema Composition. (_Currently, it supports `@key, @requires, @extends, and @external` directives)
At query execution time, it orchestrates the GraphQL queries to the appropriate micro-services, using the popular [graphql-java](https://github.com/graphql-java/graphql-java)
library as the execution engine.
### Features
* [Apollo Federation Style Schema Composition](https://netflix.github.io/dgs/federation/)
* [Recursive Stitching](https://graph-quilt.github.io/docs/merging-types/)
* [Query Batching](https://graph-quilt.github.io/docs/graphql-query-execution/)
* [Type Conflict Resolution Strategy](https://graph-quilt.github.io/docs/conflict-resolution/)
* [Pluggable `graphql-java` Instrumentation](https://github.com/graph-quilt/graphql-authorization-java)
## Getting Started
### Dependency
```xml
com.intuit.graphql
graphql-orchestrator-java
${graphql.orchestrator.version}
```
### Usage in code
* Implement the ServiceProvider interface. You will need a new instance for each GraphQL Service.
Consider the following 2 service providers below
```java
class PersonNameService implements ServiceProvider {
public static final String schema =
"type Query { person: Person } "
+ "type Person { firstName : String lastName: String }";
@Override
public String getNameSpace() { return "PERSON_NAME"; }
@Override
public Map sdlFiles() { return ImmutableMap.of("schema.graphqls", schema); }
@Override
public CompletableFuture