UDF GraphQL resolver with nested type

Hi @ClaudiaGiv!

first, you want @index here. The docs provide such an example, so you should check that out.

In fact, fauna will automatically generate the index Query with just the following

type Query {
  boardsByTitle(title: String): [Board!]!
}

if you want to piggy back the existing index then call out @index(name: 'board_by_title')

But if you want to use a UDF, do not attempt to expand the related field. The strategy is to return just the an array of Documents. Or a whole Page. If you are not paginating, then your UDF would return something like Select('data', Paginate(...))

See also:

1 Like