Skip to content

Commit

Permalink
Merge pull request #1 from apollographql-education/lh/final-revisions
Browse files Browse the repository at this point in the history
Lh/final revisions
  • Loading branch information
lizhennessy authored Feb 6, 2024
2 parents 3afd6cb + c341759 commit 9bfdd61
Show file tree
Hide file tree
Showing 11 changed files with 615 additions and 207 deletions.
75 changes: 36 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
# Apollo Server Typescript Subgraph Template

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/WdJd2w?referralCode=xsbY2R)

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](https://www.apollographql.com/docs/rover/commands/template/) 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](https://www.apollographql.com/docs/graphos/routing/cloud-configuration#managing-secrets) and set the ROUTER_SECRET environment variable wherever you deploy this to.

[apollo federation]: https://www.apollographql.com/docs/federation/
[@apollo/server]: https://www.apollographql.com/docs/apollo-server/
[@apollo/subgraph]: https://www.apollographql.com/docs/federation/subgraphs
[rover]: https://www.apollographql.com/docs/rover/
[nodemon]: https://www.npmjs.com/package/nodemon
[GraphQL Code Generator]: https://www.the-guild.dev/graphql/codegen
# (Odyssey Course) Intro to GraphQL with TypeScript

Welcome to the starter code for **Intro to GraphQL with TypeScript**. You can find the [course lessons and instructions](https://apollographql.com/tutorials/intro-typescript) on Odyssey, [Apollo](https://apollographql.com)'s learning platform.

## How to use this repo

The course will walk you step by step on what to do. This codebase is the starting point of your journey!

Navigate to the root of the project directory, and run the following commands.

```
npm install && npm run dev
```

The `final` branch of this repo contains the final stage of the course, with all of the steps and code completed! If you get stuck, you can refer to it and compare your code.

## Getting Help

This repo is _not regularly monitored_.

For any issues or problems concerning the course content, please refer to the [Odyssey topic in our community forums](https://community.apollographql.com/tags/c/help/6/odyssey). You can also [join the Apollo Discord](https://discord.gg/graphos).


# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official TypeScript documentation]([https://docs.gradle.org](https://www.typescriptlang.org/docs/))







4 changes: 2 additions & 2 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const config: CodegenConfig = {
Playlist: "./models#PlaylistModel",
Track: "./models#TrackModel",
AddItemsToPlaylistPayload: "./models#AddItemsToPlaylistPayloadModel",
},
},
}
}
},
},
};
Expand Down
Loading

0 comments on commit 9bfdd61

Please sign in to comment.