Querydeck Docs
  • 👋Welcome to Query Deck
  • Getting Started
    • 😃Get Started With QueryDeck
      • Quickstart With QueryDeck
    • How It Works?
  • REST
    • Select Method
      • Joins
      • Sorting
        • Ascending/ Descending ordering
        • Dynamic Sorting
      • Filter
        • Dynamic Filtering
        • Groups
        • Exists clause
      • Pagination
        • Offset
        • Limit
    • Insert/Upsert Method
      • Nested Inserts (Joins)
      • Conflicting Columns
    • Update Method
      • Filters
    • Delete Method
    • Authentication
    • Authorization
    • Select by Id
  • GraphQL
    • Introduction to GraphQL in QueryDeck
    • Enabling GraphQL for Columns in QueryDeck
  • Testing Endpoints
Powered by GitBook
On this page
  • What is GraphQL?
  • Why Use GraphQL in QueryDeck?
  • GraphQL vs. REST
  1. GraphQL

Introduction to GraphQL in QueryDeck

What is GraphQL?

GraphQL is a query language for APIs that allows clients to request precisely the data they need. Unlike REST, which exposes multiple endpoints for different resources, GraphQL provides a single flexible endpoint where clients specify their data requirements in a structured query format.


Why Use GraphQL in QueryDeck?

QueryDeck supports GraphQL, enabling developers to interact with databases efficiently while minimizing over-fetching or under-fetching of data. With GraphQL in QueryDeck, you can:

  • Fetch multiple related objects in a single request.

  • Define specific fields to retrieve, reducing data payload size.

  • Implement filtering, sorting, and pagination dynamically.

  • Use mutations to insert, update, or delete data flexibly.

  • Handle real-time subscriptions for live data updates.


GraphQL vs. REST

Feature
GraphQL
REST

Data Fetching

Fetch only requested fields

Fetches all fields, even if unnecessary

Number of Endpoints

Single endpoint (/graphql)

Multiple endpoints per resource

Over-fetching

Avoids over-fetching by selecting fields

Can over-fetch unnecessary fields

Under-fetching

Retrieves nested data in one request

Requires multiple requests for related data

Batch Requests

Supports multiple queries in a single request

Requires multiple calls for different data

PreviousSelect by IdNextEnabling GraphQL for Columns in QueryDeck

Last updated 3 months ago