From a0ecbdb8a9a93d0eb86007ee2097b6320a1d4431 Mon Sep 17 00:00:00 2001 From: Christos Hadjiaslanis Date: Wed, 29 Jan 2025 22:12:15 +0000 Subject: [PATCH] Added more GraphQL docs to assist LLM agents. --- linera-base/src/data_types.rs | 9 ++++++++- linera-execution/src/graphql.rs | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/linera-base/src/data_types.rs b/linera-base/src/data_types.rs index 86c0a383bfe..be655628a6b 100644 --- a/linera-base/src/data_types.rs +++ b/linera-base/src/data_types.rs @@ -1134,7 +1134,14 @@ impl<'a> Deserialize<'a> for Blob { } doc_scalar!(Bytecode, "A WebAssembly module's bytecode"); -doc_scalar!(Amount, "A non-negative amount of tokens."); +doc_scalar!(Amount, r#" +A non-negative amount of tokens. + +An example of an `Amount`: +``` +"1.234" +``` +"#); doc_scalar!(BlockHeight, "A block height to identify blocks in a chain"); doc_scalar!( Timestamp, diff --git a/linera-execution/src/graphql.rs b/linera-execution/src/graphql.rs index 555c3177269..b6946845250 100644 --- a/linera-execution/src/graphql.rs +++ b/linera-execution/src/graphql.rs @@ -21,7 +21,18 @@ doc_scalar!( Epoch, "A number identifying the configuration of the chain (aka the committee)" ); -doc_scalar!(Recipient, "The recipient of a transfer"); +doc_scalar!(Recipient, r#" +The recipient of a transfer. + +An example of a `Recipient`: +```graphql +{ + Account: { + chain_id: + } +} +``` +"#); doc_scalar!(UserData, "Optional user message attached to a transfer"); doc_scalar!(ValidatorName, "The identity of a validator");