Coder Social home page Coder Social logo

subgraph-template-typescript-apollo-server-boilerplate's Introduction

Apollo Server Typescript Subgraph Template

Deploy on Railway

This template can be used to quickly create an Apollo Federation subgraph with the @apollo/subgraph and @apollo/server packages. You can use this template from Rover with rover template use --template subgraph-typescript-apollo-server.

What's Included

  • A basic, Apollo Federation subgraph with simple examples for queries, entities, and mutations. You can run this subgraph with npm start.
  • nodemon is setup for npm run dev for a hot-reloading development environment.
  • Example tests in the src/__tests__ directory. You can run these tests with npm run test.
  • GitHub Actions workflows which will:
    • Run npm run test on every push.
    • Check the schema against Apollo Studio on every push.
    • Publish the subgraph to Apollo Studio on every push to the main branch.
  • GraphQL Code Generator pre-configured as a build step.

Next Steps

  • Setup project with npm install
    • This will also run the postinstall script which will run codegen and compile the project
  • Download Rover and start it using the command printed out from cargo run to start a local version of Apollo Explorer.
  • Replace "name" in package.json with the name of your subgraph.
  • Start filling in your own schema in schema.graphql.
  • Start filling in your own types and resolvers in src/resolvers.
  • Set these secrets in GitHub Actions to enable all checks:
    • APOLLO_KEY: An Apollo Studio API key for the supergraph to enable schema checks and publishing of the subgraph.
    • APOLLO_GRAPH_REF: The name of the supergraph in Apollo Studio.
    • PRODUCTION_URL: The URL of the deployed subgraph that the supergraph gateway will route to.
  • Remove the if: false lines from .github/workflows/checks.yaml and .github/workflows/deploy.yaml to enable schema checks and publishing.
  • Write your custom deploy logic in .github/workflows/deploy.yaml.
  • Send the Router-Authorization header from your Cloud router and set the ROUTER_SECRET environment variable wherever you deploy this to.

subgraph-template-typescript-apollo-server-boilerplate's People

Contributors

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

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

subgraph-template-typescript-apollo-server-boilerplate's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Detected dependencies

github-actions
.github/workflows/apollo.yaml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
.github/workflows/check-schema.yaml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4
.github/workflows/publish-schema.yaml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
npm
package.json
  • @apollo/server ^4.3.3
  • @apollo/subgraph ^2.3.1
  • @graphql-codegen/cli ^5.0.0
  • @graphql-codegen/typescript ^4.0.0
  • @graphql-codegen/typescript-resolvers ^4.0.0
  • @types/jest ^29.0.3
  • @types/node ^20.0.0
  • jest ^29.0.3
  • nodemon ^3.0.0
  • ts-jest ^29.0.2
  • ts-node ^10.9.1
  • typescript ^5.0.0
  • node >=18.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.