Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 75c9bbe

Browse files
author
Matthieu Vachon
committed
Updated GraphQL schema API files
1 parent 8c1dadb commit 75c9bbe

File tree

3 files changed

+57
-15
lines changed

3 files changed

+57
-15
lines changed

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,35 @@ To start the hugo server, run this command:
2121
hugo server
2222
```
2323

24+
### GraphQL API Reference
25+
26+
The GraphQL API Reference content is generated straight from the GraphQL schema of the different products
27+
we support.
28+
29+
To update them, a pre-defined project layout on disk is expected by the script. You must have the three
30+
following project colocated as siblings alongside the `docs` project:
31+
32+
- `docs`
33+
- `dfuse-eosio`
34+
- `dfuse-ethereum`
35+
36+
The later two must be named verbatim, the first one `docs` could be named whatever you like. Once the
37+
following layout exist on your local workstation, to update the GraphQL generate API reference data,
38+
first install the script dependencies:
39+
40+
```
41+
npm install
42+
```
43+
44+
Then run the following command:
45+
46+
```
47+
node graphql.js
48+
```
49+
50+
This should update the file `data/eos/graphql.json` and `data/eth/graphql.json` (and any other
51+
chains we now support) if the GraphQL schema has been updated.
52+
2453
## Content Structure
2554

2655
All content can be found in the `/content` directory. The structure of the website is generated automatically based on the structure of that directory.
@@ -62,7 +91,7 @@ For example the example snippet is from the file:
6291
└── ...
6392
```
6493

65-
When hugo builds the site, the code sections are extracted and stored in the `data` folder in project root.
94+
When hugo builds the site, the code sections are extracted and stored in the `data` folder in project root.
6695
Example code can then be referenced with the following shortcode:
6796
```go
6897
{{< code-section "quickstarts_javascript_node_eos_section1" >}}

data/eos/graphql.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1814,15 +1814,15 @@
18141814
{
18151815
"name": "DBOp",
18161816
"hideChildren": true,
1817-
"description": "Represents the mutation of a row, in a contract table.",
1817+
"description": "Represents the change delta of a row, in a contract table.\n\nThe `operation` field can be used to determine what happened\nto the row. Was is just inserted, modified or deleted?",
18181818
"fields": [
18191819
{
18201820
"name": "operation",
18211821
"type": {
18221822
"reqType": true,
18231823
"name": "DB_OPERATION"
18241824
},
1825-
"description": "",
1825+
"description": "The `operation` type should be referred to when inspecting the `oldData`, `oldJSON`, `newData`, `newJSON`\nfields. The `operation`'s value will determine what those value will contain.\n\nAssume the following example fields values (for brievity and clarity, we show the `oldJSON`\nand the `newJSON` fields, but the concept applies equally to `oldData` and `newData` which\nare the Hexadecimal binary version of the JSON):\n\n```\n { operation: \"INS\", newJSON: { \"id\":1, \"name\": \"john\" }, oldJSON: <nil> } }\n { operation: UPD, newJSON: { \"id\":1, \"name\": \"johnny\"}, oldJSON: { \"id\":1, \"name\": \"john\" } }\n { operation: REM, newJSON: <nil>, oldJSON: { \"id\":1, \"name\": \"johnny\" } }\n```\n\nWhen the `operation` type is `\"INS\"`, the `oldJSON` will be `null`, since it's a new row,\nit cannot have a previous state, the `newJSON` will be set with the new value just inserted.\n\nWhen the `operation` type is `\"UPD\"`, the `newJSON` will contain the new row's value after\nthe update while the `oldJSON` will be set with the value the row had before being updated.\n\nWhen the `operation` type is `\"REM\"`, the `newJSON` will be `null`, since it's a deleted row,\nno new state exists, the `oldJSON` will be set with the value the row had before being\ndeleted.",
18261826
"arguments": []
18271827
},
18281828
{

data/eth/graphql.json

+25-12
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,14 @@
622622
},
623623
"description": "`signature` holds the V, R and S values representing the cryptographic signature for this transaction. It is based on these values that the `from` address is derived",
624624
"arguments": []
625+
},
626+
{
627+
"name": "raw",
628+
"type": {
629+
"name": "String"
630+
},
631+
"description": "The raw signed transaction has sent to the network for inclusion into the chain. Can be null in circumstances where signed data was not recovered, for example when doing speculative execution from raw input parameters where signing data is not provided.",
632+
"arguments": []
625633
}
626634
]
627635
},
@@ -815,6 +823,14 @@
815823
"description": "`signature` holds the V, R and S values representing the cryptographic signature for this transaction. It is based on these values that the `from` address is derived",
816824
"arguments": []
817825
},
826+
{
827+
"name": "raw",
828+
"type": {
829+
"name": "String"
830+
},
831+
"description": "The raw signed transaction has sent to the network for inclusion into the chain. Can be null in circumstances where signed data was not recovered, for example when doing speculative execution from raw input parameters where signing data is not provided.",
832+
"arguments": []
833+
},
818834
{
819835
"name": "status",
820836
"type": {
@@ -1894,17 +1910,6 @@
18941910
"description": "List of the block header of the uncles (ommers) of this block",
18951911
"arguments": []
18961912
},
1897-
{
1898-
"name": "uncles",
1899-
"type": {
1900-
"isList": true,
1901-
"reqList": true,
1902-
"reqType": true,
1903-
"name": "BlockHeader"
1904-
},
1905-
"description": "",
1906-
"arguments": []
1907-
},
19081913
{
19091914
"name": "transactionTraces",
19101915
"type": {
@@ -2072,12 +2077,20 @@
20722077
"description": "blockHeader is the block on which the transaction was speculatively executed",
20732078
"arguments": []
20742079
},
2080+
{
2081+
"name": "transaction",
2082+
"type": {
2083+
"name": "Transaction"
2084+
},
2085+
"description": "transaction holds the original transaction received from the Mempool that was used to speculatively execute the transaction.",
2086+
"arguments": []
2087+
},
20752088
{
20762089
"name": "trace",
20772090
"type": {
20782091
"name": "TransactionTrace"
20792092
},
2080-
"description": "",
2093+
"description": "trace holds the speculative execution trace (includes all internal calls and theirs input/output, balance & state changes, etc).",
20812094
"arguments": []
20822095
}
20832096
]

0 commit comments

Comments
 (0)