DEV Community

Discussion on: Explain GraphQL like I'm five.

Collapse
 
nikolasburk profile image
Nikolas Burk

That's an interesting explanation and I really like the school cafeteria analogy! HOWEVER, I actually think there is a major flaw in it - here's how I would see it:

The GraphQL tray that you mentioned is actually a REST tray as it has a fixed structure! It won't let you (the 5year old student) decide what you actually want but only provides you with the things that have been prepared for you by the cafeteria in predefined portions.

Now is fantasy time! Imagine the next time you're at the cafeteria, you can tell them exactly what you like! GIVE ME THE WHOLE MEATLOAF! I WANT THAT PIECE OF CORN! NOOO PEEEAAAAS!!!!!! That's GraphQL - it gives you all the flexibility you could wish for when asking for stuff (i.e. data) instead of forcing you to ask in terms of fixed and predefined portions (i.e. structures).

Quick plug: If you want to learn more about GraphQL, check out the fullstack How to GraphQL tutorial website :)

Collapse
 
johnpaulada profile image
John Paul Ada

Cool! Thanks! :D