Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
GraphQL Best Practices

You're reading from   GraphQL Best Practices Gain hands-on experience with schema design, security, and error handling

Arrow left icon
Product type Paperback
Published in Oct 2024
Publisher Packt
ISBN-13 9781835467145
Length 422 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Artur Czemiel Artur Czemiel
Author Profile Icon Artur Czemiel
Artur Czemiel
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1 - Why GraphQL?
2. Chapter 1: Unveiling the Holy Grail of Communication – GraphQL FREE CHAPTER 3. Chapter 2: Applying an AI-Friendly Approach to GraphQL 4. Part 2 - Schema-First Design Patterns
5. Chapter 3: Crafting Effective GraphQL Schemas 6. Chapter 4: Building Pipes 7. Part 3 - Exploring Possible Ways to Use GraphQL
8. Chapter 5: Transitioning from REST to GraphQL 9. Chapter 6: Defining GraphQL Transformers 10. Chapter 7: Understanding GraphQL Federation 11. Part 4 - Advanced GraphQL
12. Chapter 8: Executing Schema-First Systems 13. Chapter 9: Working on the Frontend with GraphQL 14. Chapter 10: Keeping Data Secure 15. Chapter 11: Describing Errors in GraphQL 16. Chapter 12: Documenting your Schema 17. Chapter 13: Tackling Schemas with Visualization 18. Part 5 - From an Idea to a Working Project
19. Chapter 14: From an Idea to a Working Project – Backend Development with GraphQL and TypeScript 20. Chapter 15: From an Idea to a Working Project – Frontend Integration with GraphQL and TypeScript 21. Index 22. Other Books You May Enjoy

Executing Schema-First Systems

We have already learned a lot throughout this book, so it’s time to do something that will work both on the backend and frontend. In this chapter, we will learn how to design a schema and implement it using TypeScript and a Node.js backend for a Questions and Answers system. This app will be built on a GraphQL schema, work with a MongoDB database, and include a username-password authentication system.

Just using GraphQL Schema Definition Language to describe a system isn’t very useful. To make full use of GraphQL and this schema-driven software, you need to code a GraphQL server. To do this, we need to provide resolver functions for GraphQL-type fields, which can be done by writing the backend server for the GraphQL schema.

In this chapter, we will cover the following topics:

  • Setting up our project
  • Creating the schema
  • Connecting a database schema and a type system
  • Handling user authorization and authentication
  • ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime