# graphQL syntax Questions

**URL:** <https://community.fibery.io/t/graphql-syntax-questions/5288>\
**Category:** Get Help\
**Created:** [October 12, 2023, 10:04pm UTC](https://community.fibery.io/t/graphql-syntax-questions/5288 "2023-10-12T22:04:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 12, 2023, 10:04pm UTC](https://community.fibery.io/t/graphql-syntax-questions/5288/1 "2023-10-12T22:04:27Z")

</div>

1. How to negate a query in graphQL?  
**Answer:**

2. How to query a collection field for `isNotEmpty`? I only see `isEmpty`.  
**Answer:** `callStats: {isEmpty: false}`

3. Is it possible to reference the `record count` of a container field in a query? E,g, filter for count\>3  
**Answer:** No

4. Is it possible to use logical operators like `and`, `or`, `not` in graphQL queries/filters? I.e. filter for a Text field that is _either `null` or empty_.  
**Answer:**

5. Is it possible for a graphQL mutation to reset a Text field to `null`? I.e. the default field value, _not_ the empty string  
**Answer:** Yes: `update( fieldname: null )`

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 13, 2023, 6:37am UTC](https://community.fibery.io/t/graphql-syntax-questions/5288/2 "2023-10-13T06:37:26Z")

</div>

> [@Matt\_Blais](#):
>
> 1. How to negate a query in graphQL?

What do you mean by negate a query? Do you mean perform a subsequent query that reverses the changes?

> [@Matt\_Blais](#):
>
> 1. Is it possible to reference the `record count` of a container field in a query? E,g, filter for count\>3

The ‘count’ is not a real field that can be read, so the answer is no AFAIK.  
I believe the only thing you can do is to check if there are any linked entities (i.e. count \> 0)

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 13, 2023, 3:29pm UTC](https://community.fibery.io/t/graphql-syntax-questions/5288/3 "2023-10-13T15:29:09Z")

</div>

> [@Chr1sG](#):
>
> What do you mean by negate a query?

To logically negate (part of) a filter condition – e.g.,

```auto
not: {
   less: {a, 10} # these terms are implicitly "and"
   is: {b, "20"}
}

```

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 13, 2023, 5:23pm UTC](https://community.fibery.io/t/graphql-syntax-questions/5288/4 "2023-10-13T17:23:25Z")

</div>

**More graphQL syntax questions:**

The [graphQL docs](https://api.fibery.io/graphql.html#filtering) do not list **any** logical operators – "and, “or”, and “not” are all absent.

So how would I test whether a String field is _either_ null _or_ empty (“”)?

```auto
or: { field: {isNull: true}, field: {is: ""} }

```

* * *

**Can a graphQL “find” query return _only_ the count of records found, and no record contents?**

---

<div class="post-metadata">

**Author:** ![Oleg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oleg/32/1887_2.png) [@Oleg](https://community.fibery.io/u/Oleg)\
**Post date:** [October 16, 2023, 12:41pm UTC](https://community.fibery.io/t/graphql-syntax-questions/5288/5 "2023-10-16T12:41:10Z")

</div>

Hello, @Matt_Blais

Please find my comments below

> So how would I test whether a String field is _either_ null _or_ empty (“”)?

Indeed there is no `or` operation. We propose use several queries in this case.

```auto
{
  nullName: findProjects(name:{isNull:true}){
    id
  }
  emptyName: findProjects(name:{is:""}){
    id
  }
}

```

> **Can a graphQL “find” query return _only_ the count of records found, and no record contents?**

Unfortunately, it is not supported in GraphQL for now. However many things can be done using native [Fibery API](https://api.fibery.io/#select-fields).

Thanks,  
Oleg
