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.

This talk has been presented at GraphQL Galaxy 2022, check out the latest edition of this Tech Conference.

FAQ

GraphQL is successful due to its powerful tooling, especially GraphiQL, which provides a user-friendly interface for interacting with GraphQL APIs.

Thomas works at Stellate on various GraphQL projects and is one of the maintainers of GraphiQL.

New GraphQL developers often need to learn the syntax, explore the schema, test queries, debug issues, and document their APIs.

The first version of GraphiQL focused on learning, exploring, and developing with GraphQL, making it easy to start without setup or installation.

GraphiQL version 2 introduced a plugin API for customization, refactored components into the GraphiQL React package, and made it easier to embed and customize the tool.

Developers can override CSS variables to change colors and styles, making GraphiQL blend with their own product's design.

The Fetcher function fetches GraphQL requests. Developers can customize it to add functionalities like measuring request timing.

Future improvements include integrating the Monaco code editor, enhancing the GraphiQL Explorer, and expanding plugin capabilities.

Developers can use the GraphiQL React package to embed GraphiQL components into their websites or products, allowing users to interact with GraphQL queries directly.

Developers can find support on the official GraphQL Discord channel, and they can contribute by opening issues on the GraphiQL GitHub repository.

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
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
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
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
Envelope is a powerful GraphQL plugin system that simplifies server development and allows for powerful plugin integration. It provides conformity for large corporations with multiple GraphQL servers and can be used with various frameworks. Envelope acts as the Babel of GraphQL, allowing the use of non-spec features. The Guild offers GraphQL Hive, a service similar to Apollo Studio, and encourages collaboration with other frameworks and languages.
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
The Talk discusses the challenges and advancements in using GraphQL and React together. It introduces RedwoodJS, a framework that simplifies frontend-backend integration and provides features like code generation, scaffolding, and authentication. The Talk demonstrates how to set up a Redwood project, generate layouts and models, and perform CRUD operations. Redwood automates many GraphQL parts and provides an easy way for developers to get started with GraphQL. It also highlights the benefits of Redwood and suggests checking out RedwoodJS.com for more information.
Adopting GraphQL in an Enterprise
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
Adopting GraphQL in an Enterprise
Today's Talk is about adopting GraphQL in an enterprise. It discusses the challenges of using REST APIs and the benefits of GraphQL. The Talk explores different approaches to adopting GraphQL, including coexistence with REST APIs. It emphasizes the power of GraphQL and provides tips for successful adoption. Overall, the Talk highlights the advantages of GraphQL in terms of efficiency, collaboration, and control over APIs.
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
GraphQL has made a huge impact in the way we build client applications, websites, and mobile apps. Despite the dominance of resolvers, the GraphQL specification does not mandate their use. Introducing Graphast, a new project that compiles GraphQL operations into execution and output plans, providing advanced optimizations. In GraphFast, instead of resolvers, we have plan resolvers that deal with future data. Graphfast plan resolvers are short and efficient, supporting all features of modern GraphQL.

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
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced 2022React Advanced 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