Skip to content

parlio-nl/parlio-gateway

Repository files navigation

Parlio GraphQL Gateway

This is the GraphQL gateway used by Parlio.

Architecture

The diagram below illustrates the environment in which the gateway operates.

flowchart LR
  F(Frontend/Client)-->|HTTP| G{Gateway}
  subgraph S [Services]
    TK[Tweede Kamer API]
  end
  G -->|HTTP| TK

  click F "https://github.com/parlio-nl/parlio-frontend" _blank
  click G "https://github.com/parlio-nl/parlio-gateway" _self
  click TK "https://github.com/parlio-nl/parlio-backend" _blank
Loading

Yarn

Please install Yarn via npm install -g yarn.

The node_modules folder can be created by running yarn install.

Development environment

Running the development environment requires three separate commands (probably in different terminal windows):

  1. Use tsc:watch to start the TypeScript compiler in watch mode
  2. Use supergraph:watch to watch for changes in the rover/subgraphs folder, or rover/config/development.yaml configuration
  3. Use yarn dev to start the development environment using nodemon

Rover CLI

The Rover CLI is a tool created by Apollo to facilitate schema introspection and federated graph composition. The Rover CLI must be installed manually and is not installed by running yarn install.

The gateway uses Apollo Federation 2. You may need to install the rover-fed2 plugin .

PowerShell

To use Rover CLI with PowerShell we must configure UTF-8.

This step is not necessary when using PowerShell Core.

$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
$PSDefaultParameterValues['*:Encoding'] = 'utf8'

Fetching a subgraph

rover subgraph introspect http://localhost:8080/graphql > rover/subgraph/my-subgraph-name.graphql

Compose subgraph's

Individual schema can be composed into a supergraph by running yarn supergraph:prod (for production changes) or yarn supergraph:dev (for development changes).

The configuration files for these two composition operations live in the rover/config folder.

Prettier

Please run yarn fmt before committing.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published