Parameters¶
Parameters add query capabilities to a request (e.g., filtering, sorting, pagination). When configuring a request, you explicitly enable the parameters it should support.
This page gives an overview of all parameters.
Filter¶
The filter
parameter specifies one or more predicates to filter the data with. Predicates can be combined using
and()
and or()
to create more advanced filters.
Examples:
filter(gte(price, 500))
filter(and(gte(price, 500), has(upper(name), "STAR")))
Enabling the parameter:
public sealed class ApiSchema : Schema
{
protected override void OnInitializeSchema(ISchemaConfigBuilder schema)
{
schema.Request("listSets")
.SupportsFilter();
}
}
Learn more about the filter parameter →
Sort¶
The sort
parameter defines how to sort the data. Expressions can be combined using a comma (,
).
Examples:
sort(desc(price))
sort(desc(price), asc(lower(name)))
Enabling the parameter:
public sealed class ApiSchema : Schema
{
protected override void OnInitializeSchema(ISchemaConfigBuilder schema)
{
schema.Request("listSets")
.SupportsSort();
}
}
Learn more about the sort parameter →
Skip¶
The skip
parameter specifies how many items to skip from the result set before returning data. It is commonly used for
pagination in combination with the limit
parameter.
Example:
skip(20)
Enabling the parameter:
public sealed class ApiSchema : Schema
{
protected override void OnInitializeSchema(ISchemaConfigBuilder schema)
{
schema.Request("listSets")
.SupportsSkip();
}
}
Learn more about the skip parameter →
Limit¶
The limit
parameter restricts the maximum number of items returned in a single response. It is commonly used for
pagination in combination with the skip
parameter.
Example:
limit(10)
Enabling the parameter:
public sealed class ApiSchema : Schema
{
protected override void OnInitializeSchema(ISchemaConfigBuilder schema)
{
schema.Request("listSets")
.SupportsLimit();
}
}
Learn more about the limit parameter →
Count¶
The count
parameter requests the total number of items matching the current query. It is commonly used in combination
with pagination to display the total number of available results.
Example:
count(true)
Enabling the parameter:
public sealed class ApiSchema : Schema
{
protected override void OnInitializeSchema(ISchemaConfigBuilder schema)
{
schema.Request("listSets")
.SupportsCount();
}
}
Learn more about the count parameter →
Input¶
The input
parameter specifies the input for a certain request.
Example:
input({"name": "LEGO Star Wars R2-D2"})
Enabling the parameter: