GraphQL in the World of React Server Components

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2025
November 17 - 20, 2025
New York, US & Online
See JS stars in the US biggest planetarium
Learn More
In partnership with Focus Reactive
Upcoming event
JSNation US 2025
JSNation US 2025
November 17 - 20, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

In this talk, we'll examine how GraphQL fits into the React Server Component paradigm and how to use Apollo Client, a client-side data store, in a world of streaming SSR. Starting with a demo built with only Server Components with GraphQL, and juxtaposing it with an app using only Client Components, we'll show why a framework with a client-side data store that can also interact with RSC is the best of both worlds alongside good practices when combining it with GraphQL.

This talk has been presented at React Advanced 2024, check out the latest edition of this React Conference.

FAQ

React Advanced 2024 focuses on using GraphQL with React Server Components and Apollo Client to build advanced user experiences.

GraphQL serves as a unifying layer between microservices, allowing React Server Component applications to fetch data through a unified API instead of directly querying databases.

The 'defer' directive allows certain fields in a GraphQL query to be streamed later, enabling incremental data loading and improving user experience by rendering available data sooner.

Data can be fetched by creating an Apollo Client instance scoped to a single request using the 'register Apollo Client' function and utilizing the 'getClient' helper function to perform queries in server components.

Suspense in React Server Components allows for asynchronous data fetching, enabling components to suspend until data is available, thus optimizing loading states and improving user experience.

In client components, Apollo Client uses the 'useSuspenseQuery' hook to fetch data, which is initiated during server-side rendering and streamed to the browser for rendering.

Data that seldom changes should be fetched in server components, while interactive or frequently updated data should be fetched in client components to avoid cache synchronization issues.

GraphQL fragments are reusable units of fields that allow splitting complex data into smaller parts, useful for defining data requirements for specific UI components.

Upcoming features include suspense-enabled fragments for streaming data in multi-part chunks and support for other meta frameworks built on React Server Components.

A separate package was released because working with React Server Components (RSC) requires different paradigms and practices, such as creating client instances per request to avoid cache sharing and potential data leaks.

Jerel Miller
Jerel Miller
Alessia Bellisario
Alessia Bellisario
25 min
28 Oct, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Welcome to React Advanced 2024. Gerald Miller and Alessia Bellisario discuss the pairing of GraphQL and server components and its advantages. GraphQL combined with server components has been widely adopted, allowing for initial rendering on the server and optimizing performance. React Server Components introduce a new primitive for rendering on the server and executing server-only code. GraphQL serves as a unifying layer between microservices. Data fetching in client components involves setting up an Apollo Client instance and provider. Best practices include separating data, avoiding overlap between server and client components, and using the preload query component. Optimize network requests in React using suspense boundaries and avoiding multiple requests. Fragments in GraphQL help optimize data fetching for UI components. Use fragments and the defer directive to stream data incrementally. Add suspense boundaries, useSuspenseFragment hook, and deferred directives to optimize data fetching in React components. Combine React server components and GraphQL for streaming multi-part responses and enhancing user experiences.

1. Introduction to GraphQL and Server Components

Short description:

Welcome to React Advanced 2024. Gerald Miller and Alessia Bellisario discuss the pairing of GraphQL and server components and its advantages.

Welcome, everyone, to React Advanced 2024. My name is Gerald Miller, and I am a principal software engineer at Apollo working as a full-time maintainer on Apollo Client. And hi, everyone, my name is Alessia Bellisario, and I'm a staff software engineer at Apollo also working on Apollo Client.

And I thought we would start by going back in time to last year's React Advanced London in 2023, when Gerald and I delivered a talk called How to Use Suspense and GraphQL with Apollo to Build Great User Experiences. Now, at the time, React server components were on everyone's mind, but discussing them was an explicit non-goal of our talk that showcased how to use suspense effectively with Apollo Client. And I'll just note, you can feel free to come back and use the QR code on this slide to look it up if you want to watch it later.

So, while we didn't focus on RSE last year, this year we'd like to bring you GraphQL in a world of server components. Let's talk about how and why you might pair these technologies and what this stack enables. To start, we'll pose the question that we had on our minds when we first got a glimpse of the new server components paradigm. We honestly wondered the same thing when we set out to provide some compatibility with server components and Apollo Client. And after a year, we can confidently say, yes, GraphQL does have a place in a world of server components. Thank you so much for coming to our talk. That'll be all for today.

Read also

2. The Adoption of GraphQL and Server Components

Short description:

GraphQL combined with server components has been widely adopted in the last year. Different paradigms and best practices need to be considered when working with server components. Server components allow for initial rendering on the server, optimizing performance. Apollo Client provides APIs for server-side cache bootstrapping and initial rendering.

No, but seriously, we've been really pleasantly surprised by how much GraphQL combined with server components has been adopted in the last year. And that's reflected in this trend line and this NPM download chart that we see here. This trend line has been continuing on this upward trajectory since really since day one, as we've seen more and more teams using this technology and using it in production with great results. So there's clearly something here. And this is early evidence that engineers love building with these technologies.

Yeah, but you may notice if you take a look at that screenshot there that we've released this under a different package name, you might be asking, like, why is there a need for a separate package? Why not just build this all into Apollo Client Core? And really, the answer is because working with RSC, there's just some different things that we need to keep in mind and just some paradigms that we need to keep track of. So, for example, in server components, it's a best practice that you create your client instances once per request. And the reason for that is because you don't want multiple requests between multiple users to share a cache where you might have data mixing and matching together. That can result in leaked data between your users and could result in maybe some security implications. So we provide some of the utilities to make sure that that happens correctly. And on the client component end, the data that we fetch in the client components is streamed from the server to the browser and used to hydrate the cache on the browser end. And this really helps avoid the requests on the browser themselves since we're already doing the work on the server. If you're really curious about diving into more details, because we're not going to cover too much of the explicit what's going on, I'd highly encourage you to take a look at Lenza's talk from React Advanced last year that digs a little bit deeper into more of the specifics of this library.

Ok, so let's set the table here and talk about what are server components and answer that question. Now, there's so many excellent primers on React server components out there, including Josh Como's blog post, Making Sense of React server components, from which we borrowed the idea for these diagrams. And I've linked that blog post using the QR code in the corner. And you should definitely check it out. Check out Josh's post if you'd like to read more. But here we see the lifecycle of a typical request made to an app, a React app that's using client-side rendering. So when a request comes in from the client, the server or even a CDN will reply with an HTML document that contains a script tag that tells the browser where to fetch the JavaScript bundle necessary to render your app. And this bundle contains your application code and also all the library code that your app needs to render anything to the screen. So once we see that we've downloaded the JavaScript and the browser has parsed that JavaScript, your application code can begin executing. And it's then that any data fetching that's done during render can actually begin. So this might be a fetch call to an API that executes a database query, for example. It's only when that request comes back with data that your app can render content to the screen. So you can imagine the spinners that a user might see here. Now, with server-side rendering, your React application can perform its initial render on the server, which is a nice optimization. Maybe this is just the application shell, or maybe if you're using a meta framework like Next.js, the initial server render can also include some data fetched on the server that gets injected via props for that initial server render pass. But in general, most data will be fetched on subsequent navigations in the browser after hydration that we see in the client, at which point we have the same need to traverse that client server boundary when we make a client fetch for some data that we need from the server. And it's worth noting here that Apollo Client also provides APIs for bootstrapping your cache on the server and performing that initial server render.

3. React Server Components and GraphQL Integration

Short description:

React Server Components introduce a new primitive for rendering once on the server and executing server-only code. GraphQL serves as a unifying layer between microservices in a growing architecture. Apollo Client and server components allow for scoped client instances and data fetching on the server. Best practices include putting rarely changing data in server components and avoiding overlap with data fetched in client components.

So this is a well-tested technique and approach. But with React Server Components, React introduced a new primitive, and that is this new server component that only renders once on the server. So its dependencies are guaranteed to never end up in your client bundle and you can execute server-only code, like connecting directly to a database that we see here.

It's also worth mentioning that under this model, client components is a bit of a misnomer, since client components are also rendered on the server during an initial server-side rendering pass. But you might be wondering, like we're talking about databases a lot, like where does GraphQL actually fit into our overall application architecture? So we can take a look at this diagram here, and really this you start to see this like when your product in your organization starts to grow.

So your architecture may start to evolve and resemble something that looks more like this, where your service actually starts to split among many different services and creating a microservice architecture. So you might split your services by function or by team. But really the point here is that you may no longer be talking to a database directly. And this is where GraphQL really shines because it can create that unifying layer between all of your microservices and give you a unified API that your clients can talk to. So in this case, our React Server Component application will talk directly to our GraphQL API in order to fetch its data. So let's return to our visualization of our React Server Component request here and a request from client to server where we can now replace that database query with a GraphQL query. And here, if we zoom in a little bit more, we can see in this server render area of our diagram, we have both the React Server Components themselves and client components that do an initial render during that SSR pass on the server.

So I'm going to zoom in a little bit and take a look at fetching data in server components using Apollo Client. So let's take a look at some code here. We're first going to import this register Apollo Client function along with Apollo Client in-memory cache from our Next.js app support package. Using the register Apollo Client function, we require that you create your Apollo Client instance in the callback of that function. So as I mentioned earlier, one of the reasons we needed that additional package is because we want to make sure that our client is scoped to a single request. That way our cache is not shared between multiple requests, i.e. potentially multiple users. Otherwise, we could risk leaking user data.

That register Apollo Client function returns a helper function called getClient that when called, returns our Apollo Client instance scoped to that request. So we can use this to fetch data in our server components. So let's actually take a look at a server component and using this getClient function. So here we have our asynchronous server component. And because we're in the server component, we can just use the await keyword directly and await our request here. The biggest difference between the core Apollo Client package and our app package is really that use of that getClient function to get access to our client instance, in which we can call query on it. We can then use the data returned directly by that request to render the rest of our server component. I just want to point out some best practices when working with server components. What should we put in here versus data fetched in client components? Ideally, you want to put data in here that seldom changes and you really don't want to overlap data in your server components with data fetched in client components. Client components are really meant for interactivity, which means that the cache and the data in that cache changes over time.

4. Data Fetching in Client Components

Short description:

When using client components, it's important to separate data to avoid synchronization issues. Fetching data in client components involves setting up an Apollo Client instance and provider. Data can be fetched using the useSuspenseQuery hook, and the response is streamed to the browser for rendering. Best practices include fetching and consuming data that may change and avoiding overlapping data between server and client components. Starting fetches early in server components and rendering data in client components is possible with the preload query component provided by Apollo Client.

If you have data that overlaps between the two, it's really easy for that data to grow out of sync with each other and be out of date. The caches are not shared between your server components and your client components. So you really want to make sure that that data is separated as much as possible.

Thanks, Gerald. Now, let's take a closer look at data fetching in client components. And here's an example of a client component that is where we can instantiate our Apollo Client instance and also set up our Apollo Client provider. And what you may notice here is that at the very top, we have our use client directive to indicate that we're now entering that client component boundary. And we're importing Apollo Next app provider, Apollo Client and in-memory cache from our experimental Next.js app support package instead of Apollo Client. And we also require that you create a make client function that creates a new instance of the client and pass that function into Apollo Next app provider. And remember that React context can't be used in server components. So that's why we have to perform this setup in a client component. But otherwise, a lot of this will look fairly familiar to Apollo Client users out there.

And let's take a look at how we would actually fetch data in a client component. So here we can see again with use client, we're in a client component here where we will be executing this all products query and fetching a list of products from our GraphQL API. And we're able to import use suspense query directly from Apollo Client as we normally would to use this suspense enabled data fetching hook to execute our query in our client component. And what's amazing about this is that this fetch request will actually be initiated during that SSR pass and the data will be streamed to the browser where it will ultimately be rendered.

So to review some best practices for client components here, it's really the inverse of what Gerald spoke of about server components. So here we want to fetch and consume data that may change as a result of mutations and user interactions. And so this is where our app will really be able to benefit from our normalized cache in Apollo Client and we'll be able to rerender and react to cache updates as they occur in the client. And so, again, when you structure your queries, this is where we don't want to have overlapping data fetched between our server and client components because, again, we don't want that to get out of sync. So if we zoom in again at that server render, you'll note that our server components actually render and start fetching before our client components. But as we know, one of the great tenants of performance in React apps is starting your fetch as early as possible. So it'd be really nice if we could start our fetch in our server components, but yet render that data in our client components. So we can actually do this inside of Apollo Client in our server components by using an extra utility returned by that register Apollo Client function. And this gives us back a preload query component that we can use to do exactly this. So we take a look at our example here. We can use this in our server components by wrapping our client components as children. So at the top, you'll see our app component here where our preload query component wraps our all products component, and that all products component is our client component in this example. Something to point out here is that you'll notice that the query passed a preload query and to use the suspense query is the same query. And that's because we want to make sure that the request is shared between the two.

5. Data Fetching Best Practices

Short description:

To avoid data synchronization issues, don't use arbitrary queries and preload query. Share queries between server and client components. Avoid overlapping data rendered by server and client components to prevent cache and data inconsistency. Fetch data with preload query specifically for interactivity in client components.

So I should mention, too, that we have another way of reading data from the query, but I'd encourage you to go look at the docs for that because we're not going to be looking at that too much today. So in terms of best practices and using this, I just want to point out a couple of practices here. You don't want to use arbitrary queries and preload query, because, again, the point of doing this is to be able to share that request between your your server component and your client component. So those queries are meant to be shared between each other. And much like client components, we don't want to overlap data rendered by a server component. So, yes, it is fetched by a server component, but because it is rendered by a client component, the same principle applies. It's really easy for your cache and the data to get out of sync if you're rendering that data in both. So just make sure that the data fetched by preload query is really meant for your interactivity and those client components.

6. Interactions between Server and Client Components

Short description:

Explore how server and client components interact in an application. Understand the impact of slow queries and the importance of optimizing them. Identify the slowest fields in a query, such as reviews. Discuss the trade-off between making a single network request and the performance of slow fields.

All right. Now, let's take some of those concepts and see how they apply in an application. So here's an experience that we might have in our app. Now in this wireframe, the green boxes represent server components that are rendering data that rarely changes. And our more interactive content is rendered by a client component, which eventually loads in. But what happens when the query that our client component is making takes a while? Let's look at this example again, but with real timing in here. So that took three seconds for that query to resolve and the data to be streamed to our client components that ultimately rendered it.

And this is the GraphQL query that is backing this UI. So in our all products query, we're fetching a list of products and all of these fields, the ID, the title, media URL to show that image and a list of reviews that contain product ratings. And through some telemetry, we've identified that the reviews are the slowest field in our query. And again, this is one of the strengths of GraphQL in that it allows you to make a single network request for all of the data needs for your UI. But the flip side of that is that your query is going to be as slow as its slowest fields. And so here we know that we could render the rest of our product information much sooner, but we have these reviews that are slowing us down. So can we do better here?

7. Optimizing Network Requests in React

Short description:

Explore how to optimize network requests in React by using suspense boundaries and GraphQL. Discuss the importance of avoiding multiple network requests for component data.

And then we'll let our reviews kind of stream in later. And so we know that React provides a way to to mark parts of our subtree with loading states by adding additional suspense boundaries. But that also means that we need those components to suspend. So what might we actually do here? Ideally, we'd like to stick with a single network request so that we can avoid, in this case, an end plus one query problem. We don't really want to execute additional fetches for those reviews for each of those products. So let's take a look at what GraphQL might be able to do to help us here.

8. Using Fragments and the Defer Directive in GraphQL

Short description:

Learn how fragments in GraphQL can help optimize data fetching for UI components. Discover the use of the defer directive to stream data incrementally and improve the user experience.

So let's take a look at what GraphQL might be able to do to help us here. So first, we're going to dig into fragments a little bit and talk about what those are. So for those that aren't familiar with GraphQL, fragments, fragments are essentially reusable units and they're a subset of fields that let us split our complicated application data into smaller chunks. This can be really useful if you want to combine lots of UI components together into a single data fetch where each of those fragment defines data requirements for a component.

And here's what it looks like syntactically. So on the bottom, you see our fragment definition, which includes the fields that we want to include as part of that fragment. So in this case, it's that reviews field that you see there. We can include that fragment in our query using that spread like syntax that you see above. So this just makes sure that the fields in that fragment are fetched as a part of our query.

And here is how that query and the fragment that it contains can map onto the components that we're rendering. So here we can see the title and media URL where those are rendered and and the reviews which are rendered beneath. And again, to to the point that Gerald made around how fragments can allow you to scope those data needs of a specific component. This is where we'll see our product reviews component that are rendering the stars. Just declaring that that data requirement through the use of a fragment and Apollo clients use fragment hook.

So, you know, in this case, all products are rendered beneath and all reviews are rendered beneath. So, you know, in this case, all products is fetching all of the data that this UI needs. But product reviews is rendering the reviews data using that use fragment hook. And it's worth noting that fragments aren't enough on their own to improve the user experience here, because while they give us a way to include the product reviews, the product reviews components data in our query, we're still waiting for all of the fields to resolve before we can render our page. So let's turn to something else that GraphQL gives us here to solve this problem, and that is the defer directive.

What is the defer directive? So defer allows us to mark a set of fields as deferred within our query. We still get the benefit of a single network request, but defer tells our GraphQL server to stream those deferred fields in later via a multi-part response. And this gives us that ability to stream in data incrementally. This can really provide a great experience for situations where some fields take much longer to resolve than others. And this is what it looks like in our query. It's essentially allowing us to annotate that product fields fragment with a defer directive to indicate that all of the fields within product fields can be streamed in at a later time.

So we've learned about these utilities, but how do we actually use this in our application? So let's actually do this and we're going to walk through a demo of this in action. I just want to point out before we go too far that what we're about to show you here is highly experimental. It's not yet released in Apollo Client, but we are working on this functionality and we want to add this to a future release. So we just wanted to be able to get excited about the future with you on the possibilities that using GraphQL in the React server component architecture provides. So let's dig in.

9. Optimizing Data Fetching in React Components

Short description:

Learn how to add suspense boundaries, useSuspenseFragment hook, and deferred directives to optimize data fetching in React components. Discover how combining React server components and GraphQL enables streaming of multi-part responses and enhances user experiences.

So we know that we can provide additional fallbacks and spinners like loading states in our React components by adding suspense boundaries to our components. So we're going to start by adding a suspense boundary around our product reviews component because what we really want is for that product reviews component to suspend so that we can show some of those details about the product as soon as possible before those reviews stream in later.

Taking a look at our product reviews component, again, we want this to suspend. So we're going to replace useFragment with the useSuspenseFragment hook. And this just provides us the ability to give a suspense enabled fragment where if that fragment has not yet loaded in, we will suspend until it is. And finally, we want to go back to our query and annotate our fragment with that deferred directive so that we can tell it to stream in later.

So let's actually see a demo of this in action and how these changes can work with our application. So this demo here puts all of these pieces together. Here we see a Next.js app using React server components and the app directory that begins fetching our query on the server in our server component using preload query. And that query contains the deferred directive on our ratings fields. And the ratings component here is able to suspend on the client until that chunk is streamed to the browser. So here we see the best of React server components and the best of GraphQL combined and some of the things that become possible. We can maintain the single fetch that GraphQL gives us, but with the power of suspense and defer, that multi-part response can actually be streamed across that server client boundary that enables some pretty amazing user experiences.

So what did we hear today? Today, we talked about how Apollo's Next.js package gives you mechanisms for first fetching data directly in React server components to be rendered by server components, but also a way for preloading with preload query so that you can begin fetching data in RSC that can be rendered in client components. And also, you're able to use Apollo Client's suspense-enabled data fetching hooks directly in your client components where that fetch will actually be initiated on the server and the data will be streamed to the browser where it's rendered. And finally, coming soon, you'll be able to use suspense-enabled fragments and stream and render multi-part chunks to the browser. And finally, we're also working on supporting other meta frameworks built on RSC. So with all that said, that's all we have today. Thank you so much. Thanks, everyone.

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

Simplifying Server Components
React Advanced 2023React Advanced 2023
27 min
Simplifying Server Components
Top Content
Watch video: Simplifying Server Components
React server components simplify server-side rendering and provide a mental model of components as pure functions. Using React as a library for server components allows for building a basic RSC server and connecting it to an SSR server. RSC responses are serialized virtual DOM that offload code from the client and handle interactivity. The client manifest maps serialized placeholders to real components on the client, enabling dynamic rendering. Server components combine the best of classic web development and progressive enhancement, offering the advantage of moving logic from the client to the server.
Exploring React Server Component Fundamentals
React Day Berlin 2023React Day Berlin 2023
21 min
Exploring React Server Component Fundamentals
Top Content
Watch video: Exploring React Server Component Fundamentals
This Talk introduces React Server Components (RSC) and explores their serialization process. It compares RSC to traditional server-side rendering (SSR) and explains how RSC handles promises and integrates client components. The Talk also discusses the RSC manifest and deserialization process. The speaker then introduces the Waku framework, which supports bundling, server, routing, and SSR. The future plans for Waku include integration with client state management libraries.
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.
And Now You Understand React Server Components
React Summit 2024React Summit 2024
27 min
And Now You Understand React Server Components
Top Content
In this Talk, Kent C. Dodds introduces React Server Components (RSCs) and demonstrates how to build them from scratch. He explains the process of integrating RSCs with the UI, switching to RSC and streaming for improved performance, and the benefits of using RSCs with async components. Dodds also discusses enhancements with streaming and server context, client support and loaders, server component rendering and module resolution, handling UI updates and rendering, handling back buttons and caching, and concludes with further resources for diving deeper into the topic.
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.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
Watch video: A Practical Guide for Migrating to Server Components
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.

Workshops on related topic

Mastering React Server Components and Server Actions in React 19
React Summit US 2024React Summit US 2024
150 min
Mastering React Server Components and Server Actions in React 19
Featured Workshop
Maurice de Beijer
Maurice de Beijer
Calling all React developers! Join us for an immersive 4-hour workshop diving deep into React Server Components and Server Actions. Discover how these game-changing technologies are revolutionizing web development and learn how to harness their full potential to build lightning-fast, efficient applications.

Explore the world of React Server Components, seamlessly blending server-side rendering with client-side interactivity for unmatched performance and user experience. Dive into React Server Actions to see how they combine client-side interactivity with server-side logic, making it easier to develop interactive applications without traditional API constraints.

Get hands-on experience with practical exercises, real-world examples, and expert guidance on implementing these technologies into your projects. Learn essential topics such as the differences between Server and Client Components, optimizing data fetching, passing data effectively, and maximizing performance with new React hooks like useActionState, useFormStatus and useOptimistic.

Whether you're new to React or a seasoned pro, this workshop will equip you with the knowledge and tools to elevate your web development skills. Stay ahead of the curve and master the cutting-edge technology of React 19. Don't miss out - sign up now and unleash the full power of React!
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
Workshop
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.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
Workshop
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
The Gateway to Backend: A Frontend Developer's Guide to Full-Stack Development
React Summit US 2023React Summit US 2023
160 min
The Gateway to Backend: A Frontend Developer's Guide to Full-Stack Development
Top Content
WorkshopFree
Amy Dutton
Amy Dutton
This workshop will guide you through the product development life cycle of creating a real-world web application. You will learn about React Server Components, building a design system within Storybook, and using frontend development to approach becoming a full-stack developer. The workshop will cover increasing confidence in your application with unit tests and implementing authentication and authorization. You'll have the opportunity to work through product features and examine a real-world RedwoodJS project, gaining valuable experience in real-world product development. RedwoodJS makes it simple to approach full-stack development, and this workshop will give you the skills you need to create your own real-world web applications.
Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Workshop
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
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
Workshop
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