Relatude Help

33.10 Who reads, and the limits

Who reads. Every query runs in a query context (§29), and an endpoint, its facet page included, shows only what that context can read.

  • An endpoint made in the admin UI reads as an anonymous visitor (QueryContext.Anonymous): the published nodes that are not hidden and that everyone may read.
  • A code-first endpoint reads in the context its QueryContextFactory returns, such as a signed-in user read from the request, and as an anonymous visitor without one.

Keeping it closed. The switches that matter:

  • apiKeys turns away every request without a valid key, the facet page's data included.
  • With enableIntrospection off, the schema is not served (__schema, __type, ?sdl and the explorer). Queries themselves are not affected.
  • With enableGetRequests off, a query cannot be put in a link.
  • Leave allowMutations off unless the endpoint has a key, and mark types that clients must not change as readOnly.

The limits keep one request from costing too much:

  • maxQueryDepth caps how deeply a selection nests;
  • maxIncludeDepth caps how many relations deep it goes;
  • maxPageSize caps the page size.

A request over a depth limit is refused as a whole, with an error and no data. A page size over the maximum is cut down to it. A "many" relation field without top returns all its related nodes, so where one node has thousands of related nodes, query from the other side or use a view.