diff --git a/contactql/inspect.go b/contactql/inspect.go index 28a3bd88f..85e1c4864 100644 --- a/contactql/inspect.go +++ b/contactql/inspect.go @@ -36,7 +36,7 @@ func Inspect(query *ContactQuery) *Inspection { case PropertyTypeAttribute: attributes[c.propKey] = true - if c.propKey == AttributeGroup { + if c.propKey == AttributeGroup && c.value != "" { if query.resolver != nil { group := query.resolver.ResolveGroup(c.value) addRef(assets.NewGroupReference(group.UUID(), group.Name())) diff --git a/contactql/inspect_test.go b/contactql/inspect_test.go index 819decd24..ccfcbcdf1 100644 --- a/contactql/inspect_test.go +++ b/contactql/inspect_test.go @@ -102,6 +102,17 @@ func TestInspect(t *testing.T) { AllowAsGroup: false, }, }, + { + query: "group = \"\"", // group presence parsed with resolver + resolver: resolver, + inspection: &contactql.Inspection{ + Attributes: []string{"group"}, + Schemes: []string{}, + Fields: []*assets.FieldReference{}, + Groups: []*assets.GroupReference{}, + AllowAsGroup: false, + }, + }, } for _, tc := range tests {