diff --git a/rfc/0003 RFC GraphQL API for Duniter Client.md b/rfc/0003 RFC GraphQL API for Duniter Client.md index 5c91c8b3cfc4144a5304347b8bc564570640da21..0b705cd7ba0942ef570d94c9074c1bf97880c2c6 100644 --- a/rfc/0003 RFC GraphQL API for Duniter Client.md +++ b/rfc/0003 RFC GraphQL API for Duniter Client.md @@ -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