Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'string_enum' is not allowing 'not_eq' operator #402

Open
aravindaytha12 opened this issue Feb 2, 2022 · 3 comments
Open

'string_enum' is not allowing 'not_eq' operator #402

aravindaytha12 opened this issue Feb 2, 2022 · 3 comments

Comments

@aravindaytha12
Copy link

aravindaytha12 commented Feb 2, 2022

Hi * need a small suggestion,

  • Currently 'string_enum attribute' allowing only 'eq' operator but does not allows 'not_eq' operator
  • Is there any specific reason for not considering 'string_enum' in default_operators list
  • Only canonical name 'enum' is considered for both 'string_enum' and 'integer_enum' at default_operators method

- Reference:

  https://github.com/graphiti-api/graphiti/blob/master/lib/graphiti/filter_operators.rb#L8
  https://github.com/graphiti-api/graphiti/blob/master/lib/graphiti/adapters/abstract.rb#L27

- Example:

  MyResource.all({ filter: { status: { eq: 'done' } } }).data # 'eq' is allowed operator for 'string_enum'
  MyResource.all({ filter: { status: { not_eq: 'done' } } }).data # Throws us an error, Supported operators are [:eq]
@richmolj
Copy link
Contributor

richmolj commented Feb 8, 2022

  • I think this was an oversight
  • Let's add it!
  • Correct

@aravindaytha12
Copy link
Author

  • I think this was an oversight
  • Let's add it!
  • Correct

Thanks for the reply, Can please look into this Pull_request, if this considerable
#403

@elDub
Copy link

elDub commented Aug 17, 2023

I just ran into this as well. Is the PR supplied sufficient for the managing team to merge in? It looked simple enough.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants