Hello, everyone. I'm super happy to be here. I hope you all are doing fine. I'm going to talk a little bit about falling in love with Relay. So this is my journey of kind of being skeptical about Relay as a GraphQL client and then gradually falling in love with it.
My name is Tanna Gopal, and before I get started, I'll give you a quick introduction. So I'm the founder and CEO at Hasura. Hasura is an open source technology startup. We build a GraphQL engine that can connect to primarily your database and other services so that you can kind of stitch across them and get a unified GraphQL API. It runs as a docker container in your own infrastructure. It's open source under the Apache license, and you can check it out on GitHub. A lot of this work and this talk has been kind of motivated by the fact that we've been adding Relay support in Hasura, and towards the end I'll show you how you can kind of get started playing around with Relay and Hasura.
All right, so let's dive into Relay. When you think about GraphQL and you think about integrating GraphQL into your applications, the biggest selling point of GraphQL is that, at least for me, was that it was for the first time an API that I found easy to explore and integrate, right? So it was like I can kind of look at the way the API is, I can autocomplete it, I can look at the, you know, I can understand how I need to integrate the API because I can look at the types, right? I can integrate that with my type system, whatever I'm using on the client side. And stuff like that. Where Relay fits in is that Relay handles the responsibility or Relay makes it easy for us to achieve the theoretical best data fetch, right? That we can possibly achieve while using GraphQL and staying sane. So I'm going to talk about the staying sane aspect, right? So how can, while using GraphQL in our app, right? What is the best possible data fetching that we can do while introducing the least amount of burden on ourselves as developers, right? So that's kind of where Relay fits in. And this is going to become more clear as we go along and this is why Relay is amazing and the ideas behind Relay are really amazing.
So to kind of motivate or kind of look at one example through this talk, what I'm going to do is take the example of a data dashboard, right? So this is a front-end application. It's a React app. It's a data admin dashboard, right? So you can see that there are tables on the left. I'm looking at a particular table. That table has columns, that table has a filtering option, right? There's stuff like that. This app is actually the Hasura console, which is a React app. But in any case, imagine that this is a fairly, like medium complex, React application, just because there's a lot of data fetch happening. So if you look at the red boxes that I've kind of highlighted here, let me just bring in my pointer. If you look at these red boxes that I've highlighted here, right, those are kind of the different pieces of data that we're fetching from our API. So here we're fetching a list of all of the tables, right? Here we're fetching information about that particular table. We're only displaying the table name here. Here we're fetching a list of all of the columns so that we can render this dropdown and the column type so that we can render the operations that you can filter on that column.
Comments