ngareleo / donald

Mapesa platform
https://donald-rstm.vercel.app
1 stars 0 forks source link

Setup apollo graphql server in donald #30

Open ngareleo opened 2 months ago

ngareleo commented 2 months ago

Bootstrap apollo gql server

We want to take advantage of gql performance boost. Comparing REST to graphql, the latter makes the web development process and libraries like relay are taking advantage of grapql to make server calls efficient. Using graphql you can effortlessly crunch 4 api calls into a single call.

e.g.


 query widget {
      transactions {
            id
           location {
                id
                name
           }
           amount
   }
 }

This one query can reduce calls to /transactions then, /location/:id along with filtering that will need to be done after each call without verbose code.

Next steps

Now that you're sold onto grapql. We will need

  1. Add apollo-server to donald
  2. Add relay to lucy
  3. Convert components in lucy to use grapql