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
In /query and /mutate endpoint, we need to specify Content-Type -.
* /query -> application/graphql or application/json
* /mutate -> application/rdf or application/json
Curl has a `--compressed` option that automatically requests for a compressed response (`Accept-Encoding` header) and decompresses the compressed response.
767
774
768
775
```sh
769
-
$ curl -X POST --compressed localhost:8080/query -d $'schema {}'
Copy file name to clipboardExpand all lines: wiki/content/get-started/index.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -201,7 +201,7 @@ Ratel's default port is 8081, so override it using -p 8000.
201
201
## Step 3: Run Queries
202
202
{{% notice "tip" %}}Once Dgraph is running, you can access Ratel at [`http://localhost:8000`](http://localhost:8000). It allows browser-based queries, mutations and visualizations.
203
203
204
-
The mutations and queries below can either be run from the command line using `curl localhost:8080/query -XPOST -d $'...'` or by pasting everything between the two `'` into the running user interface on localhost.{{% /notice %}}
204
+
The mutations and queries below can either be run from the command line using `curl -H "Content-Type: application/graphql" localhost:8080/query -XPOST -d $'...'` or by pasting everything between the two `'` into the running user interface on localhost.{{% /notice %}}
205
205
206
206
### Dataset
207
207
The dataset is a movie graph, where and the graph nodes are entities of the type directors, actors, genres, or movies.
@@ -211,7 +211,7 @@ Changing the data stored in Dgraph is a mutation. The following mutation stores
The k-shortest path algorithm (used when numPaths > 1)also accepts the arguments ```minweight``` and ```maxweight```, which take a float as their value. When they are passed, only paths within the weight range ```[minweight, maxweight]``` will be considered as valid paths. This can be used, for example, to query the shortest paths that traverse between 2 and 4 nodes.
path as shortest(from: 0x2, to: 0x5, numpaths: 2, minweight: 2, maxweight: 4) {
3033
3033
friend
3034
3034
}
@@ -3067,8 +3067,8 @@ Some points to keep in mind while using recurse queries are:
3067
3067
3068
3068
`fragment` keyword allows you to define new fragments that can be referenced in a query, as per [GraphQL specification](https://facebook.github.io/graphql/#sec-Language.Fragments). The point is that if there are multiple parts which query the same set of fields, you can define a fragment and refer to it multiple times instead. Fragments can be nested inside fragments, but no cycles are allowed. Here is one contrived example.
0 commit comments