Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The Design of Web APIs - best practices for GraphQL

 
Ranch Hand
Posts: 181
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think for REST based APIs, there is more guidance available about how to design these APIs. However, for more chatty APIs like GraphQL, not enough material is available. Does the book cover that part?
 
Author
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Though focusing on REST as a main example, The Design of Web APIs aims to teach design principles that you can use for any type of APIs. Most of the principles you will find in my book can be applied to GraphQL APIs but you will have to do some work on your side to apply them on this API style.
And why talking about "chatty GraphQL", wasn't GraphQL supposed to solved the "chatty REST APIs"  problems? ;-)

Arnaud
 
Salil Wadnerkar
Ranch Hand
Posts: 181
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, "chatty" was the wrong word; I meant "verbose"
 
Arnaud Lauret
Author
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah ok. Indeed, GraphQL queries can be verbose because you have to state exactly what you want. The big challenge regarding GraphQL API design is consistency as there is no frame (such as the HTTP protocol uniform interface) to design an API consistent with itself and consistent with others.

Another warning about GraphQL (or any other type of API): did you actually choose to use this specific type because it is the best solution in your context or did you choose it because of "hype/we always do that/any other groundless reason"? It is really important to choose the type of API based on the context and the needs and not belief or habits.

I recommend watch Zdened Nemec amazing talk about "how to choose an API style": https://www.youtube.com/watch?v=gRZbgsmDj_0
 
Don't listen to Steve. Just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic