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
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
27b8b75b
Commit
27b8b75b
authored
7 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Add mutation example (write query)
parent
cb48958a
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 Client.md
+35
-0
35 additions, 0 deletions
rfc/0003 RFC GraphQL API for Duniter Client.md
with
35 additions
and
0 deletions
rfc/0003 RFC GraphQL API for Duniter Client.md
+
35
−
0
View file @
27b8b75b
...
...
@@ -267,11 +267,20 @@ You can use these to paginate your list and avoid a "timebomb" request.
leading to slower and bigger responses that can, at the end, crash the server.
*
```
javascript
#
Query
with
variables
and
default
values
query
getIdentities
(
$offset
:
Int
=
0
,
$limit
:
Int
=
1000
)
{
Identities
{
uid
}
}
#
Variables
values
for
the
request
{
"
offset
"
:
1000
,
"
limit
"
:
1000
}
```
List response:
...
...
@@ -292,4 +301,30 @@ List response:
**Send an Identity Document:**
GraphQL use another type of query to modifiy server's data. It is called "mutation".
As arguments, you must use "input objects" defined in the schema on the server.
```
javascript
#
Send
a
write
mutation
mutation
sendIdentityDocument
(
$identityRaw
:
InputIdentityRaw
!
)
{
Identity
}
#
Variables
{
"
identityRaw
"
:
"
Version: 10
\n
Type: Identity
\n
Currency: CURRENCY_NAME
\n
Issuer: PUBLIC_KEY
\n
UniqueID: USER_ID
\n
Timestamp: BLOCK_UID
\n
SIGNATURE
"
}
```
## Duniter Server module
The Duniter module handling the GraphQL API on the server.
TODO
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