Skip to content

"Unsupported type" error on codegen when custom type in Map #1371

@sraver

Description

@sraver

Describe the bug
"Unsupported type" error raises on the type generation when using custom types on a Map on the schema.graphql.
It also happens on the generation of types when importing an interface with custom types on a Map.

Please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Define an interface like:
type Module {
    getMetadata: Metadata!
}

type Metadata {
    tokens: Map! @annotate(type: "Map<String!, [Token!]!>!")
}

type Token {
    address: String!
}
  1. Build and deploy the interface
  2. Import the interface into a module as usual, and implement type Module implements Interface_Module {}
  3. Generate types yarn codegen

Expected behavior
Process should complete as usual and the types should be created inside src/wrap

Screenshots / logs

...
✅ Manifest loaded from ./src/__tests__/types/polywrap.app.yaml
🔄 Generate types
❌ Failed to generate types: Error: Unsupported type Token
Error: Unsupported type Token

Relevant environment details:

  • Debian 11
  • Polywrap 0.9.3

Additional context
The error doesn't happen when instead of a custom type, a primitive one is used, like String.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions