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! 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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Supercharging Node.js Applications with Sequelize

You're reading from   Supercharging Node.js Applications with Sequelize Create high-quality Node.js apps effortlessly while interacting with your SQL database

Arrow left icon
Product type Paperback
Published in Oct 2022
Publisher Packt
ISBN-13 9781801811552
Length 266 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Durante Daniel Durante
Author Profile Icon Daniel Durante
Daniel Durante
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Part 1 – Installation, Configuration, and the Basics
2. Chapter 1: Introduction to Sequelize and ORM in Node.js FREE CHAPTER 3. Chapter 2: Defining and Using Sequelize Models 4. Part 2 – Validating, Customizing, and Associating Your Data
5. Chapter 3: Validating Models 6. Chapter 4: Associating Models 7. Chapter 5: Adding Hooks and Lifecycle Events to Your Models 8. Chapter 6: Implementing Transactions with Sequelize 9. Chapter 7: Handling Customized, JSON, and Blob Data Types 10. Part 3 – Advanced Queries, Using Adapters, and Logging Queries
11. Chapter 8: Logging and Monitoring Your Application 12. Chapter 9: Using and Creating Adapters 13. Chapter 10: Deploying a Sequelize Application 14. Index 15. Other Books You May Enjoy

Integrating Sequelize with GraphQL

GraphQL offers a few advantages over alternatives such as REST. We can declare data shapes with strong types, associate relational hierarchies, and reduce the number of requests required when querying data.

GraphQL is a query language that is data storage-agnostic. You can associate a GraphQL model with a typical Database Management System (DBMS), or just as an abstraction for model validation and shaping.

Here is an example of a GraphQL schema definition:

type User {
  name: String!
  bio: String
  roles: [Role!]!
}
type Role {
  name: String!
}

The User type has three attributes, with the name and roles being required (indicated with the exclamation mark), while the bio definition is an optional string. Within this example, the User type’s roles attributes will always return an array with zero or more items from the exclamation mark that sits outside of the brackets ([…]!), and the...

lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Supercharging Node.js Applications with Sequelize
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 $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon