Directives

Directives define various characteristics of your schema. They can map query or mutation types to resolvers, define how object types are persisted in the database, and specify indexes to use for particular queries.

Every directive name is prefixed with the "at" sign (@). This section describes the directives provided by the Fauna GraphQL API.

@collection

Specifies the name of the underlying collection for this type. Used on top-level object types.

@embedded

Specifies that this type should be embedded as a sub-document in another object type. This type exists solely within another top-level object type and will not be persisted to a collection of its own.

@index

Specifies the name of the underlying index for this field. Used on query types and individual fields within an object type.

@relation

Declares bi-directional relationships between object types. Used on fields within object types.

@resolver

Specifies a user-defined function for resolving this field. Used within query and mutation types, but not on object types.

@unique

Specifies the name of an index to enforce a uniqueness constraint. Used on fields within an object type.