Skip to content

fix(cli): preserve empty strings in nullable entity setters - #2186

Open
GeekyKartikey wants to merge 1 commit into
graphprotocol:mainfrom
GeekyKartikey:fix/2180-nullable-strings
Open

GeekyKartikey wants to merge 1 commit into
graphprotocol:mainfrom
GeekyKartikey:fix/2180-nullable-strings

Conversation

@GeekyKartikey

Copy link
Copy Markdown

Fixes #2180

If a token returns "" for its symbol, assigning it to a nullable string field currently clears the field. Reading it back then gives null.

I changed the generated setter to call unset only when the value is null. An empty string now gets stored like any other string.

I updated the expected setter in the schema test. All eight schema tests passed. A separate local check covered empty strings, nonempty strings and null for text fields, string IDs and references.

The only failure in the CLI unit tests was the Gnosis start block lookup, which also failed on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated setter for a nullable String stores null when the value is ""

1 participant