You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Query Variable page (https://dgraph.io/docs/query-language/query-variables/) is confusing in how it differs from Value Variables. I was expecting "Query Variables" to describe how to send an external value into the query using $varname.
After some time I realized "query variables" are actually variables who's use is to store UIDs (objects) and value variables store primitive values (indexed by UID). So you can call val(valueVar) but only call uid(queryVar). "Query Variable" does not seem to be a widely used term elsewhere.
Also there is a "GraphQL Variable" page within the DQL section, which defines is what I expected. But the term "GraphQL variable" is not well-defined, and I think this should be renamed to "Using variables in DQL" with a note that it is basically the same as GraphQL. This is my best guess for the intent of the "GraphQL Variables" page inside the DQL section.
Three elements should be specifically called out:
Is the sending of the variables the same. I.e. in HTTP or gRPC calls to a DQL endpoint, is the same header, encoding etc. used to specify the variables.
Is the declaration of the variables in the query the same? E.g. a formal parameter list with $variable values.
Is the use of the variables the same? E.g. can you use a declared "$variable" wherever a constant or list is valid?
The text was updated successfully, but these errors were encountered:
The Query Variable page (https://dgraph.io/docs/query-language/query-variables/) is confusing in how it differs from Value Variables. I was expecting "Query Variables" to describe how to send an external value into the query using $varname.
After some time I realized "query variables" are actually variables who's use is to store UIDs (objects) and value variables store primitive values (indexed by UID). So you can call val(valueVar) but only call uid(queryVar). "Query Variable" does not seem to be a widely used term elsewhere.
Also there is a "GraphQL Variable" page within the DQL section, which defines is what I expected. But the term "GraphQL variable" is not well-defined, and I think this should be renamed to "Using variables in DQL" with a note that it is basically the same as GraphQL. This is my best guess for the intent of the "GraphQL Variables" page inside the DQL section.
Three elements should be specifically called out:
The text was updated successfully, but these errors were encountered: