GraphQL | Stack | Fluid Attacks Help

GraphQL

Rationale

GraphQL is the query language we use for our official API.

The main reasons why we chose it over other alternatives are:

  1. It is Open source.
  2. It provides a very flexible syntax that allows end users to fetch exactly the data they need.
  3. It allows front-ends to inherit all the API types by using its schema.
  4. It makes versioning way easier by allowing to deprecate specific queries and mutations, which allows us to keep evolving our API without having to introduce major changes.
  5. It supports playgrounds, which are ideal for comfortably learning and interacting with the API.
  6. Although it is harder to protect a GraphQL API against DoS attacks due to its flexibility, it still supports validations like query breath and depth.

Alternatives

The following alternatives were considered but not chosen for the following reasons:

REST

  1. It provided a much more limited syntax for end users.
  2. It makes versioning harder as entire endpoints must be deprecated, losing granularity and forcing us to introduce major changes to keep compatibility.
  3. Protecting it against DoS attacks is easier due to its limited flexibility.

Usage

We use GraphQL as the query language for our official API.