GraphQL 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.

Directives

@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.

@generateUDFResolvers

Specifies that the GraphQL API should create CRUD UDFs for annotated Types.

@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.