Skip to content

graph-quilt/graphql-gateway-java

Repository files navigation

graphql-gateway-java

 Master Build and Publish codecov Apache 2

Overview

graphql-gateway-java exposes data from various graph microservices using a single unified GraphQL schema. These microservices can be dynamically registered with the Gateway using the /register endpoint. It uses graphql orchestrator library for federating schemas from various data providers.

Highlights:

  • Dynamic registration so that the gateway is loosely coupled with the provider development lifecycle.
  • Registering REST endpoints using the @adapter directive and Service DSL
  • Attribute Based Access Control using the graphql-authorization-java library.

Prerequisites

Make sure you have the following installed on your machine:

Running graphql-gateway-java locally

When running the application locally, localstack is used to mock AWS S3. Follow these steps to start the application.

  1. Build the project:

    mvn clean install
    
  2. Run aws configure. Enter any value to the prompts presented. Since localstack is used, a real AWS credential is not needed, but make sure to input a valid region name (e.g. us-west-1) and output format (e.g. json).

    aws configure
    
  3. Start Docker daemon if not already running.

  4. Start the local registry. This starts a localstack docker container.

    ./local_registry/start.sh
    
  5. Set up the local registry. This will initialize the registry with example service providers in local_registry folder.

    ./local_registry/setup.sh --empty-registry
    
  6. Start the application. Once started, it listens on port 7000.

    ./run.sh
    

    OR

    Run the class GraphqlGatewayApplication as Spring Application using IntelliJ. Set the active profile as local.

NOTE: You do not need to restart the application when you register a new provider service.

Test using GraphiQL

Documentation

Intellij development

Contributing

Please see our contribution guide.

Releases

No releases published

Packages

No packages published

Languages