The old REST model is like ordering pizza, then getting groceries delivered, then calling your dry cleaner to get your clothes. Sacha Grief wrote an awesome analogy in their article "So what’s this GraphQL thing I keep hearing about?". GraphQL becomes really helpful as our apps evolve over time and need to display different data. That can become pretty bulky pretty fast, and can also become a bottleneck if you're working with separate frontend and backend teams. Well, according to its documentation, "GraphQL is a query language for APIs." Traditionally, with a REST API, you have all sorts of endpoints where you get access to different data or can change the data in some way. Here is a deployed version of it! (Note: it's using the Heroku free tier so it may take a few seconds to boot up) We'll build a drawing app that looks something like this: We'll talk about what GraphQL even is, what Hasura is, how to set up Hasura and a database, and then build a full React app on top of it. I want to share a tutorial on building a realtime game (with websockets!!!!) on Hasura based on a workshop I did with them earlier this year. It makes getting up and running with a full Postgres + GraphQL backend a breeze - you can pretty much click some things, and then you have a fully interactive database-explorer and editor and GraphQL endpoints you can test with GraphIQL. My favorite technology discovery of 2019 was Hasura.
0 Comments
Leave a Reply. |