Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
doc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
common
doc
Commits
b2dfce26
Commit
b2dfce26
authored
6 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Fix syntax highlighting
parent
e93b9407
No related branches found
No related tags found
1 merge request
!3
WIP: RFC 3 : GraphQL API for Duniter Client
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
rfc/0003 RFC GraphQL API for Duniter Clients.md
+28
-25
28 additions, 25 deletions
rfc/0003 RFC GraphQL API for Duniter Clients.md
with
28 additions
and
25 deletions
rfc/0003 RFC GraphQL API for Duniter Clients.md
+
28
−
25
View file @
b2dfce26
...
@@ -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:**
```
j
avascript
```
j
son
{
{
"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:
```
j
avascript
```
j
son
{
{
"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:
```
j
avascript
```
j
son
{
{
"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:
```
j
avascript
```
j
son
{
{
"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
```
G
raph
QL
```
g
raph
ql
schema
{
schema
{
query
:
Query
query
:
Query
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment