Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
monitz87 opened this issue Mar 27, 2023 · 0 comments

Comments

@monitz87
Copy link

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.

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

No branches or pull requests

1 participant