A directive allows you to customise the behaviour of your data model. Hypi's built in directives allow you to tell Hypi how to interact with your fields.

So, what is a directive

A @ character followed by a series of character identifies a directive, optionally followed by a list of named arguments, which can appear after almost any form of syntax in the GraphQL query or schema languages.

For example, we can imagine a UI component that has a summarised and detailed view, where one includes more fields than the other.

type Item {
slug: String! @field(indexed: true, type: Keyword)
title: String! @field(indexed: true)
description: String @field(indexed: true)
comments: [Comment!]

Here, the @field part of the model is a directive. It tells Hypi to index the field it appears next to so that data in that field is searchable with ArcQL

Built-in directives

The Hypi platform provides many directives for you to use in your app.


When applied causes the value of the field it is applied to to be resolved using an HTTP query configured with the given parameters Variable substitution is supported of the form $ (See velocity template guide) The following may be referenced vars and settings vars refers to any arguments on the field the directive is applied to so $vars.firstName refers to the firstName arg of the field settings refers to any instance settings provided in the app


A directive which allows any GraphQL definition's field to be provided by a Hypi Arc Tan function. This means that any field in your GraphQL model can get its value from a serverless function.


If present on an object then it controls which Hypi CRUD functions will be generated for the type. It can be used to prevent e.g. the create function from being generated.


Fields annotated with the @secret directive are never returned. They can only be compared using ArcQL. This is good for password fields. Note: The value of these fields CANNOT be retrieved. You can only run queries to check if the original value matches.

Secrets are encrypted using one of three available algorithms: 1. SHA3 2. BCRYPT 3. PKCS5


The @field directive is used to tell Hypi how to treat the field it is applied to. The indexed parameter, if true tells Hypi to index the contents of the field so that it can be searched. The type parameter tells Hypi how to index the field. There are two options, Keyword and Text. Keyword should be used for fields like IDs which need to be matched exactly. Text should be used for field that need free form search e.g. like using a search engine.


Valid on String, Object and Array fields. Check if the string or array length matches the range. Checks if the object's list of non-null fields matches the range


Check if the value is not null


Check if the string or array is not null nor empty (for strings verifies its not all whitespace).


Check if the date is in the past


Check if the date is in the future


Check if the field's value matches the regular expression given a match flag (see )


Check if the field's value is valid email


Adding this to any keyword indexed field ensures that no duplicates can be inserted for that field