Giter Site home page Giter Site logo

ishad-m-i-m / graphql-federation-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xlibb/graphql-federation-gateway

0.0 0.0 0.0 286 KB

This repository contains the source code of the Ballerina GraphQL federation gateway.

License: Apache License 2.0

Java 73.24% Ballerina 26.16% Shell 0.60%

graphql-federation-gateway's Introduction

GraphQL Federation Gateway

Build codecov GitHub Last Commit Github issues

A Graphql Federation Gateway implemented using Ballerina as the underline technology. This will generate a gateway executable for a given supergraph schema.

Using the Gateway

Prerequisites

  1. Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).

    • Oracle

    • OpenJDK

      Note: Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.

  2. Download and install Ballerina

Steps to use the gateway.

  1. Download gateway.sh

  2. To start the gateway run the following command in the terminal.

./gateway.sh -s <supergraphPath> -p <port>
  • supergraphPath is a mandatory argument.
  • If the port is not provided the default port 9090 will be used.

Try out the example

  1. Navigate into examples/astronauts_missions_example directory. There's two federated graphql services and a supergraph schema.
  2. In terminal execute ./gateway.sh -s supergraph.graphql to start the gateway.
  3. In terminal execute bal run inside both astronauts_service and missions_service directories to start the subgraph services.
  4. Navigate into astronuats_service directory and execute bal run in the terminal to start the astronauts_service subgraph service.
  5. Navigate into missions_service directory and execute bal run in the terminal to start the missions_service subgraph service.
  6. Try out the following query in the graphql client.
query {
    astronauts {
        id
        name
        missions {
            id
            designation
        }
    }
}

Build from the source.

Setup the prerequisites

  1. Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).

    • Oracle

    • OpenJDK

      Note: Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.

  2. Export your Github personal access token with the read package permissions as follows.

      export packageUser=<Username>
      export packagePAT=<Personal access token>
    

Build the source

Execute the commands below to build from the source.

Note: When running the build with test in Windows use -Pdisable=invalid-permission to skip the Windows incompatible test cases.

  1. To build the project:
./gradlew clean build
  1. To run the tests
./gradlew clean test
  1. To build the project without tests:
./gradlew clean build -x test
  1. Publish jar artifact to the local .m2 repository:
./gradlew clean build publishToMavenLocal

graphql-federation-gateway's People

Contributors

ishad-m-i-m avatar thisaruguruge avatar

graphql-federation-gateway's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.