How to use default variable and what can be used as a default variable?

default type is a string that is all. JSON is a string, but get’s no special treatment in Dgraph. There is this:

But it is for the GraphQL syntax and is a feature request not yet implemented or even accepted. I would think that if a JSON blob type was added in the GraphQL syntax though there would have to be some abstraction or lower level support in DQL instead of just a string but not necessarily.


Support for filters on non-indexed predicates was added with Dgraph v1.2.0

So yes it supports string filters as default is the same as string, just implied instead of imperative. You should review this documentation though for the difference that adding indexes to predicates gives you:

https://dgraph.io/docs/query-language/functions/

I believe to have language support you have to add the @lang directive in the DQL schema. But you can modify the schema from default to make this the case after the initial ingestion of the data.

1 Like