Execute queries and mutations against a Dgraph database
dgraph
package from the SDK:
dgraph
package are below, organized by category.
ExecuteQuery
function instead, and pass the mutations after
the query.ExecuteMutations
function instead.Mutation
objects to execute on the nodes matched by the query.Mutation
object.
Query
object from a DQL query string.
@if
directive.@if
directive.SetJson
field of the mutation to the given json
string. Returns
the Mutation
object to allow for method chaining.DelJson
field of the mutation to the given json
string. Returns
the Mutation
object to allow for method chaining.SetNquads
field of the mutation to the given nquads
string.
Returns the Mutation
object to allow for method chaining.DelNquads
field of the mutation to the given nquads
string.
Returns the Mutation
object to allow for method chaining.condition
field of the mutation to the given cond
string, which
should be a DQL @if
directive. Returns the Mutation
object to allow for
method chaining.name
and value
. name
is of type
string
, and value
can be a string, number, or boolean.Returns the *Query
object to allow for method chaining.WithVariable
method is the preferred way to set query variables in a
Query
object, and allows for fluent method chaining to add multiple variables.
For example:Execute
function, which has been replaced by the
ExecuteQuery
and ExecuteMutations
functions. You should no longer need to create a Request
object directly.