Dgraph APIs
Execute queries and mutations against a Dgraph database
While each Modus SDK offers similar capabilities, the APIs and usage may vary between languages.
Modus Dgraph APIs documentation is available on the following pages:
- AssemblyScript Dgraph APIs
- Go Dgraph APIs (this page)
The Modus Dgraph APIs allow you to run queries and mutations against a Dgraph database.
Import
To begin, import the dgraph
package from the SDK:
Dgraph APIs
The APIs in the dgraph
package are below, organized by category.
We’re constantly introducing new APIs through ongoing development with early users. Please open an issue if you have ideas on what would make Modus even more powerful for your next app!
Functions
AlterSchema
Alter the schema of a Dgraph database.
Name of the connection, as defined in the manifest.
The schema to apply to the Dgraph database.
DropAll
Drop all data from a Dgraph database.
Name of the connection, as defined in the manifest.
DropAttr
Drop an attribute from a Dgraph schema.
Name of the connection, as defined in the manifest.
The attribute to drop from the Dgraph schema.
Execute
Execute a Dgraph query or mutation using a Dgraph Request object.
Name of the connection, as defined in the manifest.
A pointer to a Dgraph Request
object, describing the query or
mutation to execute.
Types
Mutation
A Dgraph mutation object, used to execute mutations.
A JSON string representing the data to set in the mutation.
A JSON string representing the data to delete in the mutation.
A string representing the data to set in the mutation in NQuads format.
A string representing the data to delete in the mutation in NQuads format.
A string representing the condition query for the mutation.
Query
A Dgraph query object, used to execute queries.
The DQL query to execute.
A map of query variables.
Request
A Dgraph request object, used to execute queries and mutations.
Was this page helpful?