6 Comments

  1. Dominique Pijnenburg
    · Reply

    I doing tests Frontity about 1,5 years ago. I liked it in the beginning because it was specially designed for use with WordPress. But the use of the Rest API was getting really frustrating, because you needed to call upon call, when you needed to get data about requested data. With GraphQL, it’s very easy to dive deeper into this and pack it all in one single call.

    With Faust.js things get even easier because you don’t even need to write out the queries as it’s been done with the framework. In practice, to me this is even easier than what PHP developers are accustomed to. The fetching is being done by the framework under the hood.

    Report

  2. Konstantin Kovshenin
    · Reply

    With GraphQL, it’s very easy to dive deeper into this and pack it all in one single call.

    FWIW there’s a Batch Framework for the WordPress REST API, lets you pack multiple calls in one request. It’s so crucial for something like Frontity.

    https://make.wordpress.org/core/2020/11/20/rest-api-batch-framework-in-wordpress-5-6/

    Report

    • Jason
      · Reply

      It’s great that batching for REST was added to core!

      It’s still not quite the same as GraphQL that allows you to batch, but also follow nested resources.

      Like:

      {
      posts {
      nodes {
      id
      title
      author {
      node {
      id
      firstName
      avatar {
      url
      }
      }
      }
      categories {
      nodes {
      id
      name
      }
      }
      }
      }
      }

      with REST, even with batching, you’d still need to wait for the initial response for the posts endpoint to come back, then the client would have to parse that response, figure out which IDs and endpoints are relevant, then make the follow-up batch request for authors, categories, etc, but then for the next set of nested resources, like user avatars, you’d have to make more follow-up requests and track how it all comes together in the client.

      Definitely a nice improvement for the core REST API to have batch requests, but it doesn’t quite solve things for client developers that GraphQL does.

      Report

  3. Aakash Dodiya
    · Reply

    I prefer GraphQL over RESTAPI. Makes life much easier. I wonder when will wpgraphql plugin be merged with core. Not sure if that is aspired by wpgraphql creators.

    Report

  4. Deepansh Gupta
    · Reply

    Insightful post! Glad to read that wordpress is finding its growth towards a headless CMS.

    Report

Leave a Reply to Jason Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: