In this talk, we'll cover the libraries, tooling and processes we use to roll out GraphQL to hundreds of developers at Yelp.
This talk has been presented at GraphQL Galaxy 2021, check out the latest edition of this Tech Conference.
In this talk, we'll cover the libraries, tooling and processes we use to roll out GraphQL to hundreds of developers at Yelp.
This talk has been presented at GraphQL Galaxy 2021, check out the latest edition of this Tech Conference.
At Yelp, GraphQL is employed to maintain the client data API and manage the GraphQL infrastructure, which is crucial for building Yelp's web and mobile applications.
A 'dream query' is a hypothetical ideal query that developers write as if the necessary schema already exists. It's used as a communication tool and helps in conceptualizing the structure before actual implementation.
GraphQL Faker is an open-source tool used at Yelp to simulate GraphQL APIs by spinning up an IDE where developers can create queries and get autogenerated responses. It helps in extending schemas and testing queries during development.
Data loaders at Yelp are used to manage data fetching efficiently, particularly to prevent excessive network requests and optimize the use of bulk endpoints. They are a key component in Yelp's GraphQL infrastructure to handle data batching and caching.
Yelp uses several tools like GraphQL Schema Linter and GraphQL inspector to enforce schema quality and check for breaking changes. Additionally, a schema review group evaluates changes to ensure consistency and quality across the company.
Data loader code gen is a tool developed at Yelp that automates the creation of data loaders for various endpoints. It ensures a consistent interface and reduces maintenance by eliminating manual setup for each data loader, helping to manage hundreds of services efficiently.
Yelp utilizes tools like GraphQL Faker for schema testing, data loader code gen for automated data loader generation, and GraphQL Schema Linter for linting schemas. These tools and processes help streamline development and ensure consistent quality in GraphQL implementations.
This talk is about the life of a GraphQL developer at Yelp. Mark, a lead on the client data API team, will take you through the tooling and processes they've built. They'll share the scale of GraphQL usage at Yelp, with over 500 types in the schema and 10,000 QPS. The talk will also cover the importance of making good schema choices.
Hi, everyone. This talk is going to take you through what life is like as a GraphQL developer at Yelp. Specifically, I want to take you through some of the tooling and processes we've built to make our lives easier and to ship stuff safer and quicker.
So, my name is Mark, and I'm a lead on the client data API team. So, we maintain the GraphQL infrastructure used by the developers at Yelp to build our web and mobile apps. And if you want to get in touch with me about anything I'm about to say, then I'm on Twitter, it's Mark underscore Lara.
If you're not familiar with Yelp, it's a place to connect with great local businesses and find where it's good to eat or find plumbers or movers that you can read their reviews, that kind of thing. And here's a typical Yelp business page. Look at all this lovely data that we've pulled from the database. Looks useful, right? Here's what this page looks like without any data. Which is not very useful.
So, I think we can all agree that data is good. And our job is to pipe it into this page somehow. So, what I want to do is take you on a journey, and we'll go through the experience together of making a pull request and adding schema for a new feature to our GraphQL service. Along the way, I'll share the processes and tooling we've added for folks, so you can get a taste for what our developer experience is like.
Now, I want to set the scene and just share the scale of things and why we're invested in spending a lot of time on this. So, GraphQL is the modern standard for doing data fetching at Yelp. It's used by hundreds of developers across the org. There are over 500 types in the schema. 500 active persistent queries. So, that's queries that are actually being used in production within the last two weeks. And as a whole, the GraphQL service gets around 10,000 QPS. So, a lot of Yelp depends on this thing running smoothly and efficiently. Let's see what that looks like.
Okay. So, let's say we're making a brand-new product at Yelp. And there may be some existing schema that you could use. But mostly, we're gonna have to implement some new backend logic for this. So, the first thing we're gonna need to figure out is, well, what kind of query do you want to send? What kind of schema do we want? And obviously, we don't just want to add the first thing that comes to mind and commit that. Bad schema choices can be costly and hard to remove once they're used in prod.
We encourage developers to write a dream query, which is the query they wish they could write if the schema was available. We have schema reviewers who help review and point to existing types. We use GraphQL Faker, an open-source tool, to iterate and test new schema before implementing resolvers.
So, we want to keep things fairly flexible up until the point that we actually commit the code. Now, maybe you're new to the company or new to GraphQL, and you haven't quite yet got a feel for what's in the rest of the schema or what idiomatic schema looks like in general. And so, when writing out the query for your new page, we encourage developers to just write out a thing that looks like a GraphQL query and does the thing that you want. And we call this the dream query. And that's the query that you wish you could write if the schema was magically available to power it.
And from there, we have a cross or group of schema reviewers who can help review and point to existing types and such. And we found this to be a good way of communicating things and onboarding folks in a less intimidating manner. I've linked to our blog post, which describes this process in more detail and why we like it. Go check it out at the link in the slide.
So, yeah, let's go ahead with our new feature and we've written a dream query that we want to use on our new webpage. And once we've got something that we're reasonably happy with and looks good on paper, next, we can start to hammer out the schema that we'd write to power that query. And I guess really this can be done in parallel with a dream query. We're a big fan of a tool, an open-source tool called GraphQL Faker. It's a bit like GraphQL or GraphQL Playground and it spins up an IDE for you to make queries in. But you also get an editor to add new schema and new types on the fly.
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Comments