In this workshop you'll build a GraphQL API in Typescript using the SQLite chinook sample database using the following librarys (amongst others):
- Node (runtime)
- Express (web server)
- GraphQL (GraphQL for JavaScript)
- Apollo Server for Express (graphql server middleware)
- GraphQL Tools
- GraphiQL (graphql browser-based IDE)
- node-sqlite (sqlite async client)
Make sure you're set up before starting the workshop:
- Recent version of NodeJS
- Up to date VS Code
- Extensions for VS Code
- TSLint
- Prettier
- Remove any old typescript SDK entry from your system PATH (put there by old versions of VS).
The workshop is split into 5 lessons which should take around 20-30 mins each if you copy and paste code into place and do some reading / thinking / playing along the way.
Branches have been created to capture the completed code at the end of each workshop, and at the end of each step in lesson 4.
If you have problems, just check out the branch corresponding to where you want to be.
e.g.
git checkout lesson2 -f
You may need to also run an npm install
after switching branches.
Note: The workshop doc is only included in the master branch, so I suggest reading from the hosted repo rather than from local files.
If you have problems or need to jump ahead, checkout the complete code for any lesson via the corresponding branch:
- lesson1
- lesson2
- lesson3-start
- lesson3
- lesson4-step1
- lesson4-step2
- lesson4-step3
- lesson4-step4
- lesson5
e.g.
git checkout lesson2 -f
-
Start from scratch, in the almost-empty* master branch:
git checkout master
*master has a
.gitignore
andpackage.json
-
Follow the links to lesson 1 and start writing code!