$
symbol.int
, float
, bool
or string
.$age
has a default value of
95
!
. Mandatory parameters can’t
have a default value.uids
by using a string variable and by
providing the value as a quoted list in square brackets:query title($uidsParam: string = "[0x1, 0x2, 0x3]") { ... }
.
Error handling When submitting a query using parameters, Dgraph responds
with errors if
func:
var
) blocksvar
blocks) start with the keyword var
and are not returned
in the query results, but do affect the contents of query results.
Query Example: “Angelina Jolie’s movies ordered by genre”
var
blocksvar
blocks within a single query operation. You can
use variables from one var
block in any of the subsequent blocks, but not
within the same block.
Query Example: “Movies containing both Angelina Jolie and Morgan Freeman sorted
by name”
var
blocksvar
blocks in
the films block, as follows:
uid
function unions the uid
s from var
A
and B
, so you need a
filter to intersect the uid
s from var
A
and B
.
< >
in
the query.
E.g. <https://myschema.org#name>
var
) blockvar
blocks) start with the keyword var
instead of a block
name.
var blocks are not reflected in the query result. They are used to compute
query-variables which are lists of node UIDs, or
value-variables which are maps from node UIDs to
the corresponding scalar values.
Note that query-variables and value-variables can also be computed in query
blocks. In that case, the query block is used to fetch and return data, and to
define some variables which must be used in other blocks of the same query.
Variables may be used as functions parameters in filters or root criteria in
other blocks.
#
is a comment