graphiti
graphiti copied to clipboard
'string_enum' is not allowing 'not_eq' operator
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'atdefault_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]
- I think this was an oversight
- Let's add it!
- Correct
- 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 https://github.com/graphiti-api/graphiti/pull/403
I just ran into this as well. Is the PR supplied sufficient for the managing team to merge in? It looked simple enough.