GithubHelp home page GithubHelp logo

router-template's Introduction

Deploy on Railway

A starting point for deploying the Router via a Dockerfile using GraphOS Enterprise.

⚠️This template requires GraphOS Enterprise, if you'd like a similar template that does not require an enterprise plan, please open a discussion and describe your use-case and requirements.

What's included

  • router.yamlconfiguration for the router
  • Dockerfile—used to build the router for deployment
  • .apollo—contains some JSON schemas for the config files (to make IDE experience better)
  • .github/workflows/update-router-config.yaml—auto-update JSON schemas when the router version changes
  • .vscode—contains recommended VS Code settings
  • .idea—contains recommended Jetbrains editor settings
  • renovate.json—configured to keep Router up to date
  • A sample supergraph.yaml file for testing Router via rover dev. You'll need to update this file to point at the local versions of your subgraphs.

Next steps

  • Deploy to your environment of choice and set up CI/CD to deploy newer versions.
  • Enable Renovate on this repo to keep Router up to date
  • Set up a deployment preview for PRs to changes which you can run integration tests against
  • Set up secrets for each of your subgraphs so that only the routers can access them
  • Disable subgraph error inclusion, sandbox, and introspection in router.yaml once you have everything working (you probably don't want those enabled in production)

Commands

  • docker build -t router . builds the router image with the tag router for local testing.
  • rover dev --supergraph-config supergraph.yaml --router-config router.yaml to run the Router locally without Docker (using Rover). You'll need to update the supergraph.yaml file to point at the local versions of your subgraphs. Make sure to set the required environment variables ahead of time!
  • docker run -it --env APOLLO_KEY --env APOLLO_GRAPH_REF -p4000:4000 router runs the same router image you'll run in production. You can now query the router at http://localhost:4000.
    • Make sure to set the env vars APOLLO_KEY and APOLLO_GRAPH_REF first
    • You can alternatively create a file (e.g., .env) and run docker run -it --env-file .env -p4000:4000 router. Make sure not to check this file into source control!
    • Your local router will need network access to the subgraphs

router-template's People

Contributors

dbanty avatar dylan-apollo avatar michael-watson avatar renovate[bot] avatar svc-secops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cachiman

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.