hydra
v3
v3
  • Hydra
  • Hydra CLI
  • Hydra Indexer
  • Hydra Indexer Gateway
  • Hydra Processor
  • Hydra Typegen
  • Overview
    • Query Node Manifest
    • Graphql Queries
    • Pagination
    • Sorting
    • Mappings
      • Context interfaces
      • Mapping Filters
      • Mapping Types
    • Schema
      • The Goodies
      • Entities
      • Enums
      • Interfaces
      • Algebraic types
      • Full-text queries
      • Entity Relationships
      • Cross filtering
      • Variant relations
    • Architecture
  • Install Hydra
  • Migration to Hydra v2
  • What's new in Hydra v3
  • FAQ
  • Quickstart
Powered by GitBook
On this page
  • Filtering
  • Pagination
  • Ordering

Was this helpful?

  1. Overview
  2. Schema

The Goodies

The output schema automatically supports OpenCRUD filtering, pagination and ordering

PreviousSchemaNextEntities

Last updated 4 years ago

Was this helpful?

Filtering

All the scalar entity types enjoy first-class support in the output schema when it comes to filtering. The standard is known as and dictates what the filtering should look like depending on the field type. For example, if the input schema defines the following type:

type Person @entity {
    name: String!
    married: Boolean
    age: Int
    account: Bytes! @unique
    salary: BigInt
    interests: [String]
}

the output schema will support the following query:

query {
    persons(where: { name_startsWith: "Joh", age_gt: 20 }) {
      name
    }
}

Pagination

All queries enjoy pagination support by accepting offset and limit input parameters. By default, limit is set to 5.

query {
    persons(offset: 10, limit: 5) {
      name
    }
}

Ordering

The results can also be ordered by any property with natural ordering. The _DESCand _ASC suffixes indicate the direction:

query {
    persons(offset: 10, limit: 5, orderBy: name_ASC) {
      name
    }
}
OpenCRUD