How does @noagg directive work?

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 be ABCAggs.
  • 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!