Principle/Feature | Reference type definition | Example type definition | Example query |
Model type definition
|
type type_name {
field1: scalarType1!
field2: scalarType2
}
|
type Author {
id: Int!
name: String
}
|
NA
|
Models collection (support for filtering, pagination, sorting and limits)
|
type field(
distinct_on: [field_select_column!]
limit: Int
offset: Int
order_by: [field_order_by!]
where: field_bool_exp
): [Type!]!
|
type author(
distinct_on: [author_select_column!]
limit: Int
offset: Int
order_by: [author_order_by!]
where: author_bool_exp #defined below
): [author!]!
type author_bool_exp( #argument type defination
_and: [author_bool_exp!]
_not: author_bool_exp
_or: [author_bool_exp!]
id: Int_comparison_exp #defined below
name: String_comparison_exp
)
type Int_comparison_exp( #argument type defination
_eq: Int
_gt: Int
_gte: Int
_in: [Int!]
_is_null: Boolean
_lt: Int
_lte: Int
_neq: Int
_nin: [Int!]
)
|
query filteredAuthors {
author(where: {id: {_gt: 100}}, limit: 10) {
id
name
}
}
|
Collection - aggregates
|
type field_aggregate(
distinct_on: [field_select_column!]
limit: Int
offset: Int
order_by: [field_order_by!]
where: field_bool_exp
): field_aggregateType!
|
type author_aggregate(
distinct_on: [author_select_column!]
limit: Int
offset: Int
order_by: [author_order_by!]
where: author_bool_exp
): author_aggregate! #defined below
type author_aggregate( #argument type defination
aggregate: author_aggregate_fields #defined below
nodes: [author!]!
)
type author_aggregate_fields( #argument type defination
avg: author_avg_fields
count(columns: [author_select_column!]distinct: Boolean): Int!
max: author_max_fields
min: author_min_fields
stddev: author_stddev_fields
)
|
query filteredAuthorAggregate {
author_aggregate(where: {name: {_like: " Curie"}}) {
nodes {
id
name
}
aggregate {
count
}
}
}
|
Model singleton
|
type field_by_pk(id_field: scalarType1!): type
|
type author_by_pk(id: Int!): author
|
query author {
author_by_pk(id: 10) {
id
name
}
}
|
Command
|
type command_name (
args: command_args!
distinct_on: [model_select_column!]
limit: Int
offset: Int
order_by: [field_order_by!]
where: field_bool_exp
): [Type!]!
|
type search_authors(
args: search_authors_args!
distinct_on: [author_select_column!]
limit: Int
offset: Int
order_by: [author_order_by!]
where: author_bool_exp
): [author!]!
|
query findAuthors {
search_authors(args: {search: "Einstein"}) {
id
name
}
}
|