Rest API or GraphQL..the way of the future?

We have three different repos implementations of Prismic currently using the RestAPI. Thinking about using the graphQL Prismic service on our next project. Any thoughts or suggestions between the two? Is one the ‘way of the future’? It does seem like fetchLinks are a bit limited Ie. https://user-guides.prismic.io/en/articles/3392498-how-to-do-one-to-many-relationships

Hello!

From a technology agnostic perspective, it can be said that it is a matter of taste. However, there are reasons why GraphQL can be more dynamic than REST. One of the most common reasons why devs prefer it is because it eliminates over- or underfetching data. GraphQL gives you exactly what you need.

Take a look at this article that I found: GraphQL vs. REST

2 Likes

Thanks for the reply. That makes sense. I think I will move forward with the graphQL implementation on our new project; however, I am stuck at this: Apollo / graphQL WARNING: heuristic fragment matching going on!

@eng If you want to continue using REST you can use GraphQuery (FetchLinks v2) which will help you use a GraphQL-like syntax, and allows you to do selective fetching (i.e. fetch only the fields you need) and deep fetching (i.e. fetch the document + author in one request).

One of my colleagues is taking over that other thread. If you need any more help just let us know

1 Like

For us, We have been using prismic graphql at clacified intl, together with gatsby. We implemented our own prismic graphql source plugin, which is very crucial to the internal of our platform. It has not been easy, but it is really worth it. Few bug, but all good so far.

I really hope prismic will give more attention to its graphql api

Hey Harrison,

We are indeed hoping to do a round of improvements to our GraphQL api in the future. :grin:

Nice @Phil, please do :slight_smile: