code0-tech / sagittarius

The orchestrating backend for the Code0 application
4 stars 0 forks source link

Improve N+1 queries tooling for GraphQL types #129

Open Taucher2003 opened 4 months ago

Taucher2003 commented 4 months ago

Our current tooling against N+1 queries uses lookahead_field defined on the BaseObject. https://github.com/code0-tech/sagittarius/blob/9e00268087ca3d458123f80c83745e48437c9b94/app/graphql/types/base_object.rb#L20-L34

With this setup, the configuration for preloads has to be done on every type that includes the type affected by N+1 queries.

This should either be moved to resolvers or some custom tooling that defines the preloads on the affected type directly.