reym
Projections/Schema/Object

@index

Use the @index directive to apply a db index on a list of fields in order to make queries more performant.

This directive exists on field level as well: @index

You cannot create a multi column index on fields that contain array data.

Example

user.graphql
type User @upsertOn(...) @index(fields: ["name", "lastName"]) {
    name: String!
    lastName: String!
}

In this case Freym will create a composite database index on the name and lastName fields.

On this page