-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
This is a Design Doc for Dgraph v1.1 - a breaking change to make HTTP API more compatible with GraphQL.
Further reading:
In v1.1 Dgraph HTTP endpoints must have following properties:
/query
- URL
/queryaccepts HTTP POST with Content-Typeapplication/jsonand POST body in JSON format:
{
"query": "...",
"variables": { "myVariable": "someValue", ... },
"startTs": <number>,
"debug": <true/false>,
}
-
JSON field
"query"is required, all other fields are optional. -
If the "application/graphql" Content-Type header is present, treat the HTTP POST body contents as the GraphQL query string and read all other fields from the query string e.g.
/query?variables=...&startTs=...&debug=true
/mutate
-
/mutateno longer acceptsX-Dgraph-...custom headers. OPTIONS response no longer advertises the headers, if a POST request is received with any of these headers, their presence and values are ignored. -
As of dgraph v1.0.13
/mutateacceptsX-Dgraph-CommitNowandX-Dgraph-MutationType. Mutation type can be inferred from the Content Type header and thus no replacement is necessary.
CommitNow can be specified on the URL string:/mutate/<startTs>?commitNow=true
/commit
/commit does not use any of the X-Dgraph-... so no changes to its behavior are necessary.