A Graphql Federation Gateway implemented using Ballerina as the underline technology. This will generate a gateway executable for a given supergraph schema.
-
Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).
-
Download and install Ballerina
-
Download gateway.sh
-
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.
- Navigate into
examples/astronauts_missions_example
directory. There's two federated graphql services and a supergraph schema. - In terminal execute
./gateway.sh -s supergraph.graphql
to start the gateway. - In terminal execute
bal run
inside bothastronauts_service
andmissions_service
directories to start the subgraph services. - Navigate into
astronuats_service
directory and executebal run
in the terminal to start theastronauts_service
subgraph service. - Navigate into
missions_service
directory and executebal run
in the terminal to start themissions_service
subgraph service. - Try out the following query in the graphql client.
query {
astronauts {
id
name
missions {
id
designation
}
}
}
-
Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).
-
Export your Github personal access token with the read package permissions as follows.
export packageUser=<Username> export packagePAT=<Personal access token>
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.
- To build the project:
./gradlew clean build
- To run the tests
./gradlew clean test
- To build the project without tests:
./gradlew clean build -x test
- Publish
jar
artifact to the local.m2
repository:
./gradlew clean build publishToMavenLocal