-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Add an exists field to the EntityAttributeFilter input object
Schema
input EntityAttributeFilter {
attribute: String!
exists: Boolean! = true # <---------- NEW
value: String
valueNot: String
valueIn: [String!]
valueNotIn: [String!]
valueType: ValueType
valueTypeNot: ValueType
valueTypeIn: [ValueType!]
valueTypeNotIn: [ValueType!]
}Example Query
query {
entities(
# Select entities for which the name attribute ("LuBWqZAu6pz54eiJS5mLv8") exists
where: {
attributes: [
{attribute: "LuBWqZAu6pz54eiJS5mLv8", exists: true}
]
},
spaceId: "25omwWh6HYgeRQKCaSpVpa",
first: 10
) {
id
...
}
}Implementation checklist
- Update the
PropFilterstruct in thegrc20-core/src/mapping/query_utils/prop_filter.rsmodule- Add the
exists: Option<bool>field to the struct - Update the
PropFilter::subquerymethod to apply the an{field} IS NOT nullor{field} IS nullfilter (if it is notNone) to the where clause only if no other filter have been applied.
- Add the
- Update the
EntityAttributeFilterstruct in theapi/src/schema/attribute_filter.rsmodule- Add the
existsfield to the struct - Update the
impl From<EntityAttributeFilter> for mapping::AttributeFilterblock - Update the
EntityAttributeFilter::value_filtermethod to set the newexistsfield on thePropFilter
- Add the
- Test!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request