3 months studying GraphQL

1. There’re not silver bullets in Software development

Don’t think that GraphQL must be the technologies to be used in all your new projects. In fact,

2. Focused on client

Why should we implement a new API? Because someone is going to consume our services. So we should provide API clients what they really need and not only what we think we need to.

  • We cannot choice the ingredients for our pizza.
  • We can only order a pizza. If we need two pizzas we will make the queue again.
  • The server will always return the full resource. REST API clients cannot decide which information they want to retrieve. Therefore, server is wasting time and effort on providing some information that will be avoided by the clients.
  • We need to make a new request for every resource we want to consume or create .
  • A GraphQL client can take a piece of the full response and server won’t make any effort on providing the not desired information.
  • With a GraphQL API we can ask for as many resources as we need in only one request. Or we can create several resources of different type in a single request too.

3. Contract first

I love paradigms that take advantages of the contract. The contract is the base of building a good product. REST doesn’t provide a contract, and I will never do it.

4. Typed syntax

I enjoy a lot coding with untyped programming language such as Javascript or Python. However, defining an API has bigger implications that decide the language to be used to implement it.

5. Immature frameworks

GraphQL specification is so powerful but frameworks and libraries are not at all. After trying several frameworks in many languages I found that some points of the specification are hardly supported by frameworks right now; specially when we want to implement custom directives.

6. Try and learn

Learning new things is a way to understand better the new things that are coming. We can not take the right decision when we don’t know all the options. And we will hardly understand upcoming technologies if we don’t understand the current ones.

7. Read articles is fine when you are not a coder

If you only read articles or papers like this, you could get a good understanding about things but you won’t know how the things must be done. To learn things, we need to put them into practice.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store