The @index
directive creates an Index based on the types used. If you simply want to query an index (equivalent to Paginate(Match(Index("my_index")))
) then use @index
. @index
fields are paginated without additional work, but they are limited to simple index queries.
If you want to do some extra compute (maybe sorting, using multiple indexes, or manipulating the data), then use @resolver
.
Does post help? Understanding fauna auto-generation from schema
I’m not sure what you mean.
If you do not provide any directive, then Fauna assumes it is @index
. For example
type Query {
# this
thingsByColor(color: String!): [Thing]
# is equivalent to:
thingsByColor(color: String!): [Thing] @index(name: "thingsByColor")
}