Skip to content
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 Arrays of Enums #530

Open
leefordjudes opened this issue Jun 12, 2024 · 2 comments
Open

Filtering Arrays of Enums #530

leefordjudes opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@leefordjudes
Copy link

Describe the bug
#523 pg_graphql 1.5.5 - array with enum type - not working
the above issue & its fixes - fix graphql schema generation issue, and arrayfilter operators.

Now i can use array filter with text[], int[], but i can not filter enum[].
kindly add enum support for array filter.

To Reproduce
Steps to reproduce the behavior:

create type typ_base_account_type as enum (
    'DIRECT_INCOME', 'INDIRECT_INCOME', .. . . . 
    );
create table if not exists account_type
(
    id             int       not null generated by default as identity primary key,
    name           text      not null,
    base_types    typ_base_account_type[] not null,
   -- base_types     text[]    not null,
. . .
);

now insert some records

Expected behavior
Add array filter support for array with enum

Screenshots
ArrayFilter with enum array shows error:
Screenshot 2024-06-12 150424

List enum array works well
Screenshot 2024-06-12 150345

List & ArrayFilter with string, int - works well

Screenshot 2024-06-12 150206

Screenshot 2024-06-12 150250

Versions:

  • PostgreSQL: 16.3
  • pg_graphql 1.5.6
@leefordjudes leefordjudes added the triage-required Pending triage from maintainers label Jun 12, 2024
@olirice olirice added enhancement New feature or request and removed triage-required Pending triage from maintainers labels Jun 12, 2024
@olirice olirice changed the title Kindly add enum support for ArrayFilter Filtering Arrays of Enums Jun 12, 2024
@martmull
Copy link

Same issue, I would love to have filters support enums

@olirice
Copy link
Contributor

olirice commented Jun 18, 2024

The complexity comes from Enum's support for remapping variants which will require work in the transpiler to make it fully functional

Its not a blocked, but it'll require a bit more work than the other primitive scalar types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants