In the previous post, we have seen how @noinput directive works.
Now we will check how @noagg directive works.
- When you declare a data type in the schema, Hypi automatically generates Aggregate data types that are used to implement Aggregation functions.
- Let’s say you declare an
ABC
data type. The auto generated data type will beABCAggs
. - If you declare the data type with
@noagg
directive, the above-mentioned Aggregate data type will not be generated. - You will not be able to perform Aggregation functions on the data type.
Check this guide to learn more about Aggregation functions.
Declare below Data type in the schema.
type AbcObj @noagg {
field: Int
}
The Aggregation data type AbcObjAggs
will not be generated.If you try to execute an aggregation query, below error will pop up in the GraphQL Playground.
You may check below Aggregation related posts to know more!
- How to calculate an average of the set of values using Aggregation
- How to calculate a sum of the set of values using Aggregation
- How to count the number of records from a field using Aggregation
- How to retrieve maximum and minimum values from a field
- How to group records and execute aggregation queries
- How to group the records based upon the DateTime field