MENU

Fun & Interesting

Building a GraphQL server in Next.js

LogRocket 22,618 5 years ago
Video Not Working? Fix It Now

In this video, we will learn how to use API routes to set up a GraphQL API within a Next.js app. Introduction -- 00:00 Adding an API route -- 01:22 GraphQL setup -- 02:35 Getting started with GraphQL -- 6:13 Avoiding N+1 queries with DataLoader --18:55 Conclusion -- 26:24 Source code: https://github.com/leighhalliday/nextjs-graphql-example Try LogRocket for free: https://logrocket.com/?yt22 Check out the blog post: https://blog.logrocket.com/building-a-graphql-server-in-next-js/ LogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store. In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps. Try it for free: https://logrocket.com/signup/

Comment