Skip to content

"Unhandled type in converter string" when using a String entityId in uncrashable config #94

@monitz87

Description

@monitz87

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @float-capital/[email protected] for the project I'm working on.

When using entityIds of type String, they get converted to string (lowercase) by getAssemblyScriptTypeFromConfigType before being passed to toStringConverter. This makes the generated entity ID generator return "unhandled type in converter string - Please fix the converter"

Here is the diff that solved my problem:

diff --git a/node_modules/@float-capital/float-subgraph-uncrashable/src/GraphEntityGenTemplates.bs.js b/node_modules/@float-capital/float-subgraph-uncrashable/src/GraphEntityGenTemplates.bs.js
index 442728a..1f219cd 100644
--- a/node_modules/@float-capital/float-subgraph-uncrashable/src/GraphEntityGenTemplates.bs.js
+++ b/node_modules/@float-capital/float-subgraph-uncrashable/src/GraphEntityGenTemplates.bs.js
@@ -46,7 +46,7 @@ function toStringConverter(paramName, paramType) {
     case "Address" :
     case "Bytes" :
         return "" + paramName + ".toHex()";
-    case "String" :
+    case "string" :
         return paramName;
     case "BigDecimal" :
     case "BigInt" :

The other solution would be to remove the getAssemblyScriptTypeFromConfigType call from the toStringConverter call, but I guess that would have other implications

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions