forked from TryGhost/GQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Logical Operators
Laran Evans edited this page Mar 27, 2016
·
1 revision
There are two logical operators: and and or.
| GQL | JSON | SQL |
|---|---|---|
+ |
<implied> | AND |
, |
$or |
OR |
In the string API boolean operators are stated explicitly. In the JSON API conditions default to AND. OR conditions are stated explicitly with $or.
| GQL | JSON | SQL |
|---|---|---|
title:Foo+summary:Bar |
[{title:'Foo'}, {summary: 'Bar'}] |
title = 'Foo' AND summary = 'Bar' |
title:Foo,summary:Bar |
[{title:'Foo'}, {$or: {summary: 'Bar'}}] |
title = 'Foo' OR summary = 'Bar' |
Boolean conditions can be Negated and grouped together into Clauses.