GraphQL for Everyone - Danielle Man

Rate this content
Bookmark
This video talk focuses on the benefits and challenges of using GraphQL in organizations. It highlights the importance of designing flexible schemas and using tools like Apollo Studio's Explorer tool to make GraphQL more accessible. The talk discusses how GraphQL LowDash can transform query results and compares GraphQL to SQL, emphasizing the ease of querying related data without complex joins. It also explores the potential of integrating GraphQL with tools like Tableau and optimizing queries with JoinMonster. The speaker shares insights on translating Druid queries to GraphQL and the pros and cons of flexible queries. Lastly, the talk addresses the challenge of making GraphQL accessible to non-developers and the importance of schema design for performance and adoption.

From Author:

Data is knowledge and knowledge is power. One of the greatest powers we have as developers is the ability to access and manipulate raw data with ease. But it takes a lot of context to know how to write a SQL query or use an API or make a CURL request. A lot of our energy in the GraphQL community is spent moving the specification forward and improving developer tools around it, but we don't spend much time talking about what GraphQL can do to help people in our organizations beyond our developers –– our designers, product managers, business leaders, customer success engineers, etc. In this talk, I will share the outcomes of some research we did at Apollo on GraphQL accessibility, and my vision for how GraphQL can connect humans to data that impacts them much more effectively, there giving them an ability to answer their own questions.

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

FAQ

Danielle is an engineering manager at Apollo, responsible for building development tools that help people query and use GraphQL APIs.

The main focus of Danielle's talk is on how GraphQL can be used to connect people in organizations beyond just developers to data, empowering them to do their jobs more effectively.

GraphQL allows for similar querying capabilities as SQL, such as conditional selection and joining data. However, GraphQL requires building join logic into the schema and lacks built-in aggregation functions, which need to be anticipated and built into the schema.

Danielle believes GraphQL can be the standard way to model and query business data for almost all use cases, creating a universal access point for data in organizations.

The main concerns are query optimization for performance, the ability to express complex queries, and the accessibility of GraphQL to non-developers who are used to working with data in table formats.

Query optimization can be achieved by mapping GraphQL queries directly to database queries, minimizing extra processing at the GraphQL layer. Tools like JoinMonster can help translate GraphQL queries to SQL queries for better performance.

GraphQL LowDash is a node package that allows the application of LowDash functions to GraphQL queries through directives, enabling transformations such as filtering, counting, and sorting of query results.

Making GraphQL tools more accessible can enable non-developers to use GraphQL for data querying, improving data accessibility across the organization and allowing for more flexible and rapid feature development.

Apollo's team uses GraphQL to translate queries to databases like Druid, enabling flexible querying of analytics data. This approach allows for rapid iteration and automatic schema updates when new columns are added to tables.

The Explorer tool in Apollo Studio is designed to help users write GraphQL queries more easily, supporting the use of GraphQL LowDash for front-end queries, and making data more accessible through features like Table mode.

Danielle Man
Danielle Man
33 min
02 Jul, 2021

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: GraphQL para Todos - Danielle Man

1. Introduction to GraphQL and its Potential

Short description:

I'm an engineering manager at Apollo, and today I want to talk about how to fully leverage and consume a GraphQL API. GraphQL can be useful to people in your organization beyond just the developers. It can be the standard way that we model and query our business data. We will compare SQL to GraphQL and discuss the concerns of using GraphQL as a universal access point for data.

Hey, everyone. My name is Danielle, and I'm an engineering manager at Apollo where my team and I are responsible for building dev tools specifically that help people query and use GraphQL APIs. Today, I'm really excited to be sharing some of the ideas that inspire our work centered around how you can use GraphQL to connect people in your organizations beyond just your developers to data that would empower and enable them to do their jobs more effectively.

This talk is going to be a little bit different from others because instead of talking about how to build a GraphQL API and the many interesting technical challenges there, I want to talk about how to fully leverage and consume a GraphQL API. I believe that GraphQL can be useful to people in your organization way beyond just the developers who are using it to query their data. I believe that you can build a unified graph for your data for everyone to use and that it will empower people in your organization like you've never seen before.

Data accessibility is a really hard problem, and it's really hard to access data from all of our systems these days because we store it in all sorts of different places, different databases, different microservices, everything has been optimized to be for a different type of data, everything is queried in a slightly different way, and it's hard to figure all these systems out sometimes, even as developers, but there are a lot of people who could do their jobs more effectively if they could just plug into the data in our systems. And for product development, we've solved the situation of having many services that are all a little bit different by introducing a new layer with GraphQL and using it to create a singular API. And I believe that this new layer that we've introduced for our APIs with GraphQL can also be used to solve the more general problem of data access in our organizations. I believe that GraphQL can be the standard way that we model and query our business data for almost all use cases.

So with our time today, I want to walk you all through how to think about using GraphQL in this way as we pose this question of, can GraphQL be the way that we create a universal access point for our data? And to get into this topic, I want to start by walking through a SQL query together and comparing SQL to GraphQL a little bit. So this is a query that I've written many times over myself, and it's an analytics question. For each account, how many users have I seen in the last 30 days? And if I break this query apart and look at the different elements of it, there are some distinct things that stand out. The select here lets me control what I'm asking for given a platter of options which we have the exact same ability to do with GraphQL. The where here is a conditional selection. I only want to select users if I've seen them in the last 30 days. With GraphQL, we have nothing specifically in the language to express a filter like this, but we can still filter our data using arguments. The join here lets us select data across multiple tables. With GraphQL, you actually build your join logic into your schema. So the query writer doesn't have to know anything about how to join data to benefit from being able to query join's data. I actually think that the GraphQL experience here is much better for the data browser than the SQL experience because you're not kind of reconstructing your business logic around joins. And then the last thing that I want to point out for now is this ability to group and count. This idea that we have aggregation and array functions that we can apply to our queries is something that I really miss in GraphQL. If you want to query something that's computed, you have to build those computed fields into your schema, which means you have to anticipate their needs, which you can do for applications like building layouts and clients, but you can't exhaustively anticipate every need that anyone is going to have when they're just casually browsing your data. So coming back to our question of if GraphQL can be the way to create a universal access point for our data, I think the main concerns with taking this approach are going to break down into three categories that I want to walk through together. Can I optimize my queries enough for it to make sense? GraphQL is built on top of anything. Or it could be built on top of anything. So it's going to be important to consider that we may be wanting to query very large swaths of data. Number two, can I express what I want to express? I think this one comes down to what I showed you with the SQL query where GraphQL is just kind of missing computation elements in the language itself. And then number three, can I see things the way that I want to see them? GraphQL was designed to be used by developers.

2. Optimizing GraphQL Queries

Short description:

GraphQL queries can be optimized by mapping them directly to performant database queries, which is the most efficient approach. Tools like JoinMonster help in this process. For more information, refer to the blog post by Marc-Andre Giroux.

So it's not the most accessible thing to people from the data world who are very technical but are used to working with data in table formats and doing things like Excel, applying Excel formulas and being technical in that way.

So let's walk through these together and talk about whether or not these hurdles can be overcome with GraphQL.

So this first question of can I optimize my GraphQL queries enough for it to make sense? The thing that really comes to mind with this one for me is can we provide a mapping of our queries to an implementation that is performant? GraphQL is adding this layer of processing in your stack.

So the best thing we can try to do is make that layer as thin as possible and avoid adding extra processing at the GraphQL layer. And ideally, we can take the GraphQL queries that come in and map them directly to database queries, which is guaranteed to be the most performant outcome.

And there are a lot of tools that do this or that help you do this specifically with SQL that are out there. There are even companies that build a GraphQL on top of SQL as a service. And in all of those tools, what you're trying to do is take your GraphQL query and identify the precise SQL query that needs to be made to fetch the data that was asked for.

And what I have on this slide is an example of one of those libraries called JoinMonster that does this. But there's a great blog post written on the topic of GraphQL to SQL, specifically that I've linked here in this slide by Marc-Andre Giroux.

QnA

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 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