graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.56k stars 569 forks source link

Apply filters on custom resolvers #2172

Open roland-pep opened 6 days ago

roland-pep commented 6 days ago

Summary

Postgraphile plugins, like the postgraphile-plugin-connection-filter applies filters to the nodes within a connection. However, custom resolvers on the connection do not inherit these filters.

Additional context

Currently the only way to ensure custom resolvers respect the filters applied to the connection is to pass the relevant filter parameters explicitly to these resolvers. Is this correct?

benjie commented 5 days ago

Please could you provide some code to expand on what you mean? Applying filters to manually created PgSelect steps should work fine. Making sure the filter is added to args is a case of ensuring the correct scopes are set. You talk about "custom resolvers" but I don't know what that's referring to, are you referencing V4 + makeExtendSchemaPlugin perhaps?