graphile-contrib/postgraphile-plugin-connection-filter

Filtering doesn't work on SETOF functions when source table is commented as @omit all

Closed this issue · 2 comments

Given a table as such:

CREATE TABLE foo (
  id int
  distributor_id int
  name text
)

and a function as such

CREATE OR REPLACE FUNCTION foo_by_distributor_id(distributor_id int)
        RETURNS SETOF public.foo AS $$
          SELECT * FROM public.foo WHERE distributor_id = distributor_id;
      $$ LANGUAGE sql STABLE;

You get a filterable connection on fooByDistributorId, however when you add the comment @omit all to the foo table (to hide it and make the set of function the only way to access it) you lose the filter on the connection (fooByDistributorId).

Is this expected, or is there a better way to make certain parameters required in connections?

Thanks for reporting this. I agree that foo_by_distributor_id in your example should have a filter arg exposed. I'll release a fix shortly.

Fixed in v1.1.1