Coder Social home page Coder Social logo

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

Apollo Server JavaScript 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 it from Rover with rover template use --template subgraph-javascript-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.

Next Steps

  • Setup project with npm install.
  • Start the server with npm start to start a local version of Apollo Explorer.
  • Download Rover and start it using the command printed out after npm start in the previous step (which should start with something like rover dev).
  • 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. Check the Apollo documentation for how to obtain this API key.
    • APOLLO_GRAPH_REF: A string with the following format: graph_id@variant_name. You can find your graph's ID in that graph's Settings page in Studio.
    • PRODUCTION_URL: The URL of the deployed subgraph.
  • 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-javascript-apollo-server-boilerplate's People

Contributors

dbanty avatar dylan-apollo avatar lennyburdette avatar mabuyo avatar michael-watson avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lennyburdette

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

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: .github/renovate.json
Error type: Invalid JSON (parsing failed)
Message: Syntax error: expecting String near ue }, }

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@b4ffde65f46336ab88eb53be808477a3936bae11
.github/workflows/check-schema.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
.github/workflows/publish-schema.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
npm
package.json
  • @apollo/server ^4.0.0
  • @apollo/subgraph ^2.3.1
  • jest 29.7.0
  • nodemon 3.0.2
  • 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.