DEV Community

Cover image for GraphQL vs REST - a vending machine example

GraphQL vs REST - a vending machine example

Tomek Poniatowicz on December 18, 2019

Any "The Office" fans here? Do you remember the episode in which Jim put Dwight's stuff into a vending machine? This seems to an on-point example ...
Collapse
 
timolesanmann profile image
Tim-Ole Sanmann

Wow, I think, I've never seen such a symbolic and an easy understandable description of GraphQL before. I never thought about learning how to use it. But now it sounds to me like the next thing I'd like to get into.

Great Work! Thank you!

Can you recommend any tutorial, course, video or lecture for getting started? Maybe some tutorial you created?

Tim

Collapse
 
tomekponiat profile image
Tomek Poniatowicz

Thanks Tim!
You should try out Interactive Tutorial embedded in GraphQL Editor - app.graphqleditor.com/?category=tu...

As well as this post - dev.to/graphqleditor/graphql-resou...

As it gathers many GraphQL related resources :)

Collapse
 
timolesanmann profile image
Tim-Ole Sanmann

Many thanks for the Link to the page! Can't wait to come home and getting startet! :)

Collapse
 
simo97 profile image
ADONIS SIMO

yes am really happy with this description too...

Collapse
 
thandy1212 profile image
Taylor Handy

This is a bit nitpicking, but your REST example is actually an RPC example. It's not REST unless it adheres to HATEOAS

Collapse
 
calinbolea profile image
Calin Bolea

meh, it can also be level 1 or 2 of the Richardson Maturity Model.

Collapse
 
vanto profile image
Tammo van Lessen
Collapse
 
tundeajibawo profile image
Tunde Ajibawo

Spot on

Collapse
 
acsbendi profile image
Bendegúz Ács

What do you mean by that? Should there be a "links" field for every post in the example response?

Collapse
 
fly profile image
joon • Edited

Brilliant, almost immaculate analogy. I was already hooked to graphQL the first time I was introduced to it, now I'm hyped.
Unicorn for the office reference :)

Beautiful concise post. Very on point and informative.

Collapse
 
marais profile image
Marais Rossouw

Pretty cool tool mate! Must say though, I have a hard time making sense of what I'm seeing. i imported my schema, which is some 80k lines, and its just boxes! One thing though, would be cool to wrap deprecation warnings. So its labels don't fly halfway across the screen!

Collapse
 
aexol profile image
Artur Czemiel

Wow, such a big schema, maybe you can break it to smaller pieces using our GraphQL Libraries feature? What would you like to improve else? Have you tried using schema explorer to navigate it?

We take user feedback seriously so feel free to reach us via intercom or email or slack

Collapse
 
awakeel profile image
Abdul wakeel • Edited

The vending machine is example is good in this case, but what if I have two thousand different schemas(table) For each schema I will have to create graphql endpoint? Or is there any way to create a generic endpoint for All table schemes?

Collapse
 
cassiamani profile image
cassiamani

te