Yamashou / gqlgenc

This is Go library for building GraphQL client with gqlgen
MIT License
371 stars 65 forks source link

JSONObject mapped wrong #23

Open Bysmyyr opened 4 years ago

Bysmyyr commented 4 years ago

type: JSONObject is mapped to *string but it should be map[string]interface{}

but even with that fix I did not get it working...

Yamashou commented 3 years ago

Thanks! I would be grateful if you could give me the code for that problem!

hellowin commented 2 years ago

For this problem, I think we can simply create our own model, like this. In this case, I'm using Hasura, where the JSON result scalar name is jsonb.

# in .gqlgenc.yml
models:
  jsonb:
    model: github.com/yourproject/model.JSONB

Where in our code, we define something like this.

# in github.com/yourproject/model
package model

type JSONB interface{}