Skip to content

Commit e57e56d

Browse files
author
Matthieu Vachon
authored
Fixed json.fromString type definition (#41)
Also added an extra detail to `Bytes` version
1 parent 9dea80f commit e57e56d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pages/en/developer/assemblyscript-api.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ import { json, JSONValueKind } from '@graphprotocol/graph-ts'
621621

622622
JSON data can be parsed using the `json` API:
623623

624-
- `json.fromBytes(data: Bytes): JSONValue` – parses JSON data from a `Bytes` array
624+
- `json.fromBytes(data: Bytes): JSONValue` – parses JSON data from a `Bytes` array interpreted as a valid UTF-8 sequence
625625
- `json.try_fromBytes(data: Bytes): Result<JSONValue, boolean>` – safe version of `json.fromBytes`, it returns an error variant if the parsing failed
626-
- `json.fromString(data: Bytes): JSONValue` – parses JSON data from a valid UTF-8 `String`
627-
- `json.try_fromString(data: Bytes): Result<JSONValue, boolean>` – safe version of `json.fromString`, it returns an error variant if the parsing failed
626+
- `json.fromString(data: string): JSONValue` – parses JSON data from a valid UTF-8 `String`
627+
- `json.try_fromString(data: string): Result<JSONValue, boolean>` – safe version of `json.fromString`, it returns an error variant if the parsing failed
628628

629629
The `JSONValue` class provides a way to pull values out of an arbitrary JSON document. Since JSON values can be booleans, numbers, arrays and more, `JSONValue` comes with a `kind` property to check the type of a value:
630630

0 commit comments

Comments
 (0)