yugom / onboard_backend

0 stars 0 forks source link

[Track 2/9] GraphQL Setup #3

Open taki-tiler-server[bot] opened 1 year ago

taki-tiler-server[bot] commented 1 year ago

Step 1/5 - Create a git branch

If you don't remember how to create a branch, check the references in the previous issues.

Note: From here, the issues will contain fewer tutorials and step-by-step guides. However, it doesn't mean you won't be able to ask. You can always ask anything to any Taqtiler. We are here to help 😉

yugom commented 1 year ago

Finish

taki-tiler-server[bot] commented 1 year ago

Step 2/5 - GraphQL setup

Estimated time: 3 hours

In this step you'll create a basic hello-world GraphQL Node Server. But before you start, there are some core concepts you need to know in order to understand what's going on on your code. Try to do some research on your own about these topics, but feel free to ask your tutor, or even another Taqtiler, for references, tips and/or clarifications:

  1. Client-server architecture
  2. HTTP communication
  3. REST
  4. GraphQL: shema (queries, mutations, types and inputs)

When you are comfortable to follow, we suggest you take a look at the GraphQL Getting Started guide to begin your quest.

To call this step done, you must have:

  1. A simple GraphQL node server properly setup
  2. A query called hello that returns a string, for example: Hello, world!
  3. Make sure you tested your server running and performed the hello query. You should be able to access the Graphql docs and perform the query on: browser, Graphiql or Graphql Playground (you can choose the one you like). Keep this query for future testing!
yugom commented 1 year ago

Finish

taki-tiler-server[bot] commented 1 year ago

Step 3/5 - Create a Pull Request

If you don't remember how to open a Pull Request, check out the references in the previous issues. Your PR should have develop branch as base, to be merged into later.

This pull request will be reviewed by your Taqtile tutor and possibly by some other people. This process is called Code Review (CR). You can ask your tutor about who will be revising your code.

Make sure you're marking them on every Pull Request as reviewers. Check here for an example of Code Review. You'll possibly have some requested/suggested changes in order to merge this new branch on develop. Make sure to resolve all those changes before merging your branch into develop. 😉

After opening the pull request, you can continue your work on a new branch.

yugom commented 1 year ago

Finish

taki-tiler-server[bot] commented 1 year ago

Step 4/5 - Typescript and Apollo Server

Estimated time: 3 hours

In this step you'll have two main tasks: add Typescript to your project and use Apollo Server to setup GraphQL.

But first, let's create a new branch. You can call it feature/apollo-typescript-setup (but for now on, you're going to choose the branches names 😼).

Apollo Server is a nice library that we use to make GraphQL setup much easier. You can follow a tutorial of your choice on the internet to get this step done. There are a bunch of posts like "create a Node GraphQL Server with Apollo Server and Typescript" or something like that 📝.

To make sure you're done, you should test your server the same way you did on previous step: start it and check if the hello query is returning accordingly. After you finish, open a new branch (following our name conventions) and a new Pull Request.

NOTE: when you open a PR, you have to select two branches: the "compare", the branch you're working, and the "base", which is the branch you desire to merge yours. Try to choose the "base" branch that allows reviewers to see only the changed code, without showing previous PR changes. Look on the internet for ways to see your branches sketched to help you do this. If you have any difficulties, feel free to ask your tutors, or any Taqtiler 😉.