-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering on computed table type column #131
Comments
I also am wondering about this, I think this is what I need. |
Are there any plans to add this functionality? I also wonder whats the reason behind this. I definitely need this feature. |
If someone can provide an example SQL schema and GraphQL query you'd like to see supported, I can try to dig into this. Are you thinking of a function similar to this one from the test suite? create function p.filterable_computed_child(f p.filterable) returns p.child as $$
select p.child.*
from p.child
where filterable_id = f.id
limit 1;
$$ language sql stable; If so, would the intent be to allow filtering on one of more columns of |
@mattbretl It seems that I have similar problem/request. Let's say I have following DB structure: create table users (
id varchar NOT NULL
);
create table posts (
created_by varchar NOT NULL,
updated_by varchar
);
create function "users_postsByCreatedOrUpdatedBy"(usr users)
returns setof posts as $$
select posts.*
from posts
where usr.id = posts.created_by or usr.id = posts.updated_by
$$ language sql stable;
insert into users (id) values ('1');
insert into users (id) values ('2');
insert into users (id) values ('3');
insert into users (id) values ('4');
insert into posts (created_by, updated_by) values ('1', null);
insert into posts (created_by, updated_by) values ('3','4'); I would like to call a following query: query MyQuery {
allUsers(filter: {postsByCreatedOrUpdatedByExist: true}) {
edges {
node {
id
}
}
}
} I can see that the filter appears when I create the relation between created_by and user or updated_by and user, but my requirement is to find users who have created or updated at lest one post. In this example, I should see only users with ids PS. I have explicitly set graphileBuildOptions but the
|
Thank you for making this amazing library!
I wonder what's the reason for not supporting table types in computed columns?
postgraphile-plugin-connection-filter/src/PgConnectionArgFilterComputedColumnsPlugin.js
Line 61 in acc7d5c
The text was updated successfully, but these errors were encountered: