The new GraphiQL: Next-level Customizability

Rate this content
Bookmark

We shipped the next major version of GraphiQL earlier this year! We completely rethought the experience with a particular focus on customizability. Not all users and every API have the same needs for a GraphQL IDE, so one of our big goals was to allow GraphiQL to work for a large variety of use-cases. Let's dive deep into the changes of how we took the customizability to the next level and explore together how you can make GraphiQL your own.

Thomas Heyenbrock
Thomas Heyenbrock
21 min
08 Dec, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

GraphQL is successful due to its tooling and customizability, but developers face challenges such as learning, syntax, schema exploration, API building, visualization, documentation, and collaboration. GraphQL version 2 has made significant improvements, including a plugin API and building blocks in GraphQL React. Customization in GraphQL involves overriding CSS variables and building custom functionality using plugins. The ability to embed a GraphQL IDE into a blog allows users to interact with GraphQL concepts directly. Overall, GraphQL continues to evolve and adapt to the changing needs of its ecosystem.

1. Introduction to GraphQL and Its Challenges

Short description:

Welcome to my talk at GraphQL Galaxy. GraphQL is successful because of its tooling. I want to talk about GraphQL, its customizability, and taking it to the next level. The problems GraphQL developers face include learning, syntax, schema exploration, building APIs, visualization, documentation, and collaboration.

Hello folks. Welcome to my talk at GraphQL Galaxy. I hope you're having an awesome conference so far, enjoying a lot of other interesting talks, and I hope I've got another interesting one lined up for you now. And I want to open it up with a question to you. Why do you think GraphQL is so successful?

Now, I'm recording this talk, so I can't get your answer straight away, but feel free to drop your answers, comments, questions, whatever, in the chat, and let's see that we can get a conversation going. And I'll give you my answer. I believe GraphQL is so successful because of its tooling. And one tool in particular that you can also see on the screen already that I want to talk about is GraphQL.

GraphQL has been around since the release of GraphQL back in 2015. And to this day, it is the portal for me as a GraphQL developer to interact and dive into GraphQL. There's been a lot of development around GraphQL in the last year, and this is what I want to talk about to you today. And in particular, I want to focus on customizability and how you can take GraphQL to the next level.

Quick facts about me. My name is Thomas, I work at Stellate on other cool GraphQL things, and I'm one of the maintainers of GraphQL. But enough about me. Let's dive right into the topic. And I want to start with the why. Why does GraphQL exist? Let's rephrase this to what are actually the problems that GraphQL developers face? Before we talk about any kind of solutions like GraphQL.

If I'm just getting out, a big thing that I need to do is just learning. I need to learn actually what is GraphQL? How does its syntax work? Was it a Graph QL schema, exploring a schema firsthand, and having this first success moment of sending a Graph QL request and getting a response and seeing both of them side by side? Once I learn GraphQL, I grasp the concept, then I want to get my hands dirty. I start developing and building my first Graph QL API. This involves a lot of iteration, and testing out queries as I go and debugging if something is not working as I expect it to.

Graph QL already contains the word Graph in its name and a Graph is something that can very easily be laid out in a visual way where I can explore, in this case, it's the Graph QL schema, and how different types relate to each other. But it's not just the schema, also the data that the API returns to me. It's depending on the semantics of the API, this data could have certain meaning like I don't know, geolocation data, which I can visualize in a very specific way. It's also a lot about documentation. If I'm in particular, if I'm building my own API, and I want others to use it, I need to document it. And I want this immersive documentation behavior where people can dive into the docs, read through the meanings and the workings of my API. And write in there being able to start writing queries and trying it out, having these interactive embedded sandboxes where you can just get going without ever leaving the documentation. And I also want to collaborate.

2. Customizing GraphQL and Its Evolution

Short description:

Rarely I'm working by myself on a project, so I want to share any kind of queries that I'm writing with my peers, maybe also debugging, and want to easily import export all of the operations that I'm writing between different tools that I'm using. GraphQL version 2 has made significant improvements to address a wider range of problems and provide more flexibility. The addition of a plugin API and the availability of building blocks in GraphQL React make it easier to create custom IDEs. GraphQL continues to evolve and adapt to the changing needs of its growing ecosystem. Now, let's dive into a demo to see how you can customize GraphQL and make it blend seamlessly with your own product.

Rarely I'm working by myself on a project, so I want to share any kind of queries that I'm writing with my peers, maybe also debugging, and want to easily import export all of the operations that I'm writing between different tools that I'm using.

So all in all, a big set of problems. So let's see where does GraphQL fit in as a solution to these problems. Let's start with the initial, the version 1 of GraphQL, which was released back in 2015. This version was really focused and specialized on the learning, exploring and developing part, and it excelled at it. In fact, it's in my opinion a key reason why GraphQL took off and why it got so successful in the first place. Because we had this tool, GraphQL, at our fingertips, where you could just start exploring and playing with GraphQL without needing to set up or install anything. Just open it up in a browser window and go.

The other points, some of them might maybe take a few strides to it, but there was clearly room for improvements still left to do. And, in fact, earlier this year we released the next major version, version 2 of GraphQL, and we also looked at these problems and we figured we need to make GraphQL solve a wider range of these problems and make it more flexible. So what did we do? For example, we added a plugin API, so everybody can now easily write their own GraphQL plugins, which enables you to interact with GraphQL, with its UI, and also render additional components right into the UI that fit your specific API and your specific use cases. We also refactored GraphQL and broke it up into its individual parts and made all of these building blocks available with a new package called GraphQL React. And using these building blocks, it is now more easy than ever before to just take some of these components, plug them together and create your own custom IDE that is very easily embeddable into your products or your websites. Of course, version two is not the end of the road for GraphQL. There will be more things coming in the future and we want to solve an even wider range of use cases and make it even better, but more on that later on. Really coming back to what I'm trying to say here is that GraphQL has seen immense growth over the past years. And with each year there are new tools and new products entering the landscape. And I believe that GraphQL as a tool must not be fixated on the one thing that it did very well back a couple of years ago. GraphQL also needs to evolve together with GraphQL and its ecosystem.

So now is the exciting part because now I want to actually show you what this all means and how you can customize GraphQL. And for this I prepared a demo. I did setup a very simple React application, which at the moment just renders GraphQL. See the app component as my entry point here and it just renders the GraphQL component. And if I take a look at it in my browser, I will see GraphQL version 2, the new version also featuring a new design, but essentially it's the thing you know and love. If we enter a query on the left side, we can also format it and run it and we get back our data on the right side. Awesome. So let's customize this. First thing, maybe, or I hope at least to you, this looks visually appealing, but usually I want to make this blend in with my own product. I don't want to use the colors I see here. I want to use my own brand colors.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
We all love GraphQL, but it can be daunting to get a server up and running and keep your code organized, maintainable, and testable over the long term. No more! Come watch as I go from an empty directory to a fully fledged GraphQL API in minutes flat. Plus, see how easy it is to use and create directives to clean up your code even more. You're gonna love GraphQL even more once you make things Redwood Easy!
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
How many times did you implement the same flow in your application: check, if data is already fetched from the server, if yes - render the data, if not - fetch this data and then render it? I think I've done it more than ten times myself and I've seen the question about this flow more than fifty times. Unfortunately, our go-to state management library, Vuex, doesn't provide any solution for this.For GraphQL-based application, there was an alternative to use Apollo client that provided tools for working with the cache. But what if you use REST? Luckily, now we have a Vue alternative to a react-query library that provides a nice solution for working with server cache. In this talk, I will explain the distinction between local application state and local server cache and do some live coding to show how to work with the latter.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
The Guild has recently released Envelop - a new, modern GraphQL Server Framework and plugin system. In this talk I’ll share a brief overview of Envelop and why you should probably upgrade your existing GraphQL server to it.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
In this talk, we'll look at some of the modern options for building a full-stack React and GraphQL app with strong conventions and how this can be of enormous benefit to you and your team. We'll focus specifically on RedwoodJS, a full stack React framework that is often called 'Ruby on Rails for React'.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
Though GraphQL is declarative, resolvers operate field-by-field, layer-by-layer, often resulting in unnecessary work for your business logic even when using techniques such as DataLoader. In this talk, Benjie will introduce his vision for a new general-purpose GraphQL execution strategy whose holistic approach could lead to significant efficiency and scalability gains for all GraphQL APIs.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura
Building GraphQL APIs on top of Ethereum with The Graph
GraphQL Galaxy 2021GraphQL Galaxy 2021
48 min
Building GraphQL APIs on top of Ethereum with The Graph
WorkshopFree
Nader Dabit
Nader Dabit
The Graph is an indexing protocol for querying networks like Ethereum, IPFS, and other blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible.

In this workshop you’ll learn how to build a subgraph that indexes NFT blockchain data from the Foundation smart contract. We’ll deploy the API, and learn how to perform queries to retrieve data using various types of data access patterns, implementing filters and sorting.

By the end of the workshop, you should understand how to build and deploy performant APIs to The Graph to index data from any smart contract deployed to Ethereum.