LakeQL
Overview
  • Introduction
Server Setup
  • createApiServer
  • defineConfig
  • Yoga Configuration
Authentication
  • JWT Authentication
  • Permissions
  • Scope Authorization
Schema Builder
  • Builder Configuration
  • Scalar Types
  • Comparison Types
  • Pagination
  • Input Validation
Customization
  • Custom Queries & Mutations
  • Extending Core
  • CORS Configuration
GitHub
LakeQL
  1. API
  2. Schema Builder
  3. Comparison Types

On this page

  1. Available comparison types
    1. StringFieldComparison
    2. IntFieldComparison
    3. FloatFieldComparison
    4. BooleanFieldComparison
    5. DateFieldComparison
    6. DateTimeFieldComparison
    7. IDFieldComparison
  2. Usage in GraphQL queries
  3. Importing comparison types

Comparison Types

Pre-built GraphQL input types for filtering queries with typed comparison operators.

LakeQL provides seven comparison input types that power the generated Where filter inputs. Each type exposes operators appropriate for its scalar type.

Available comparison types #

StringFieldComparison #

OperatorTypeDescription
eqStringEqual to
neqStringNot equal to
likeStringSQL LIKE pattern match
notLikeStringSQL NOT LIKE pattern match
in[String]Value in list
notIn[String]Value not in list

IntFieldComparison #

OperatorTypeDescription
eqIntEqual to
neqIntNot equal to
ltIntLess than
lteIntLess than or equal
gtIntGreater than
gteIntGreater than or equal
in[Int]Value in list
notIn[Int]Value not in list

FloatFieldComparison #

OperatorTypeDescription
eqFloatEqual to
neqFloatNot equal to
ltFloatLess than
lteFloatLess than or equal
gtFloatGreater than
gteFloatGreater than or equal
in[Float]Value in list
notIn[Float]Value not in list

BooleanFieldComparison #

OperatorTypeDescription
isBooleanIs true
isNotBooleanIs false

DateFieldComparison #

OperatorTypeDescription
eqDateEqual to
neqDateNot equal to
ltDateLess than
lteDateLess than or equal
gtDateGreater than
gteDateGreater than or equal

DateTimeFieldComparison #

OperatorTypeDescription
eqDateTimeEqual to
neqDateTimeNot equal to
ltDateTimeLess than
lteDateTimeLess than or equal
gtDateTimeGreater than
gteDateTimeGreater than or equal

IDFieldComparison #

OperatorTypeDescription
eqIDEqual to
neqIDNot equal to
in[ID]Value in list
notIn[ID]Value not in list

Usage in GraphQL queries #

These comparison types appear in generated Where input types for each table. Use them to filter query results:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
query FilteredUsers {
  users(
    where: {
      age: { gte: 18, lt: 65 }
      email: { like: "%@example.com" }
      status: { in: ["active", "pending"] }
    }
  ) {
    nodes {
      id
      name
      email
    }
  }
}

Importing comparison types #

If you need to reference these types in custom schemas:

1
2
3
4
5
6
7
8
9
10
import {
  StringFieldComparison,
  IntFieldComparison,
  FloatFieldComparison,
  BooleanFieldComparison,
  DateFieldComparison,
  DateTimeFieldComparison,
  IDFieldComparison,
} from "@lakeql/api/builder"

Previous page

Scalar Types

Next page

Pagination