ENTGQL go generate ./... UUID Error (error calling gqlIDType)

242 Views Asked by At

I have a problem. I'm trying to integrate entgo with gqlgen, and my go generate ./... command doesn't work. It throws an error below

running ent codegen: execute template "client": template: 
node.tmpl:315:16: executing "client/fields/additional" at <gqlIDType 
(filterNodes $.Nodes (skipMode "type")) $.IDType>: error calling gqlIDType: 
entgql: mixed id types must be type string or implement the 
graphql.Marshaller/graphql.Unmarshaller interfaces
exit status 1
ent\generate.go:3: running "go": exit status 1

here's my entc.go file

func main() {
    ex, err := entgql.NewExtension(
        entgql.WithConfigPath("../gqlgen.yml"),
        entgql.WithSchemaGenerator(),
        entgql.WithSchemaPath("../graphql/schema.graphql"),
        entgql.WithWhereInputs(true),
        entgql.WithNodeDescriptor(true),
    )
    if err != nil {
        log.Fatalf("creating entgql extension: %v", err)
    }
    err = entc.Generate("./schema", &gen.Config{}, entc.Extensions(ex))
    if err != nil {
        log.Fatalf("running ent codegen: %v", err)
    }
}

I've googled for a while and it seems like it's the UUID id type in one of my entities problem, but i haven't found solution for this yet:(

I can send additional code and info if needed

Tried looking for example in https://github.com/ent/contrib/tree/master/entgql/internal/todouuid/ent/schema

but it didn't help to find solution

0

There are 0 best solutions below