Skip to content
Snippets Groups Projects
Commit b2dfce26 authored by Vincent Texier's avatar Vincent Texier
Browse files

Fix syntax highlighting

parent e93b9407
No related branches found
No related tags found
1 merge request!3WIP: RFC 3 : GraphQL API for Duniter Client
...@@ -161,7 +161,7 @@ The data we need when we request Identity informations are : ...@@ -161,7 +161,7 @@ The data we need when we request Identity informations are :
Parameters are mandatory, this is the key to retrieve the Identity. Parameters are mandatory, this is the key to retrieve the Identity.
Fields are optional like in any GrahQL query. Fields are optional like in any GrahQL query.
```javascript ```graphql
query getIdentity { query getIdentity {
Identity(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...") { Identity(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...") {
member member
...@@ -177,7 +177,7 @@ Fields are optional like in any GrahQL query. ...@@ -177,7 +177,7 @@ Fields are optional like in any GrahQL query.
**GraphQL Response:** **GraphQL Response:**
```javascript ```json
{ {
"data": { "data": {
"member": True, "member": True,
...@@ -201,7 +201,7 @@ Fields are optional like in any GrahQL query. ...@@ -201,7 +201,7 @@ Fields are optional like in any GrahQL query.
To get the full raw document type: To get the full raw document type:
```javascript ```graphql
query getIdentityRaw { query getIdentityRaw {
IdentityRaw(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...") IdentityRaw(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...")
} }
...@@ -209,7 +209,7 @@ query getIdentityRaw { ...@@ -209,7 +209,7 @@ query getIdentityRaw {
Returns: Returns:
```javascript ```json
{ {
"data": { "data": {
"IdentityRaw": "Version: 10\n "IdentityRaw": "Version: 10\n
...@@ -250,7 +250,7 @@ merkle check is done on raw document fields. ...@@ -250,7 +250,7 @@ merkle check is done on raw document fields.
Send the verification request: Send the verification request:
```javascript ```graphql
query getIdentityMerkleTree { query getIdentityMerkleTree {
IdentityMerkleTree(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...") IdentityMerkleTree(uid: "john", pubkey: "z7rDt7...", blockstamp: "22765-1AD84...")
} }
...@@ -258,7 +258,7 @@ query getIdentityMerkleTree { ...@@ -258,7 +258,7 @@ query getIdentityMerkleTree {
Return the root of the merkle tree: Return the root of the merkle tree:
```javascript ```json
{ {
"data": { "data": {
"IdentityMerkleTree": "478D46A98F75..." "IdentityMerkleTree": "478D46A98F75..."
...@@ -274,26 +274,27 @@ You can use these to paginate your list and avoid a "timebomb" request. ...@@ -274,26 +274,27 @@ You can use these to paginate your list and avoid a "timebomb" request.
*A "timebomb" request is a request on an infinitly growing list of entities, *A "timebomb" request is a request on an infinitly growing list of entities,
leading to slower and bigger responses that can, at the end, crash the server.* leading to slower and bigger responses that can, at the end, crash the server.*
```javascript ```graphql
# Query with variables and default values # Query with variables and default values
query getIdentities($offset: Int = 0, $limit: Int = 1000) { query getIdentities($offset: Int = 0, $limit: Int = 1000) {
Identities { Identities {
uid uid
} }
} }
```
Variables values for the request (page 2 of the list, with 1000 elements per page)
# Variables values for the request (page 2 of the list, with 1000 elements per page) ```json
{ {
"offset": 1000, "offset": 1000,
"limit": 1000 "limit": 1000
} }
``` ```
List response: List response:
```javascript ```json
{ {
"data": { "data": {
"Identities": [ "Identities": [
...@@ -314,14 +315,16 @@ It is called "mutation". ...@@ -314,14 +315,16 @@ It is called "mutation".
As arguments, you must use "input objects" defined in the schema on the server. As arguments, you must use "input objects" defined in the schema on the server.
```javascript ```graphql
# Send a write mutation # Send a write mutation
mutation sendIdentityDocument($identityRaw: InputIdentityRaw!) { mutation sendIdentityDocument($identityRaw: InputIdentityRaw!) {
Identity Identity
} }
```
Variables:
# Variables ```json
{ {
"identityRaw": "Version: 10\n "identityRaw": "Version: 10\n
Type: Identity\n Type: Identity\n
...@@ -378,7 +381,7 @@ The SSL endpoint string is: ...@@ -378,7 +381,7 @@ The SSL endpoint string is:
## API GraphQL Schema ## API GraphQL Schema
```GraphQL ```graphql
schema { schema {
query: Query query: Query
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment