Skip to content

blukai/gqlgenc-omitempty-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gqlgenc-omitempty-example

run dgraph in docker

$ docker-compose up -d

set the schema with dgraph-admin

$ dgraph-admin update-schema schema.graphql

generate modelds and client with gqlgenc

$ gqlgenc

run the example

$ go run main.go

and the response is fine

[]*gen.PlanetFragment{
  &gen.PlanetFragment{
    ID: "0x2e",
    Name: "Jupiter",
    Moons: []*struct { ID string "json:\"id\" graphql:\"id\""; Name string "json:\"name\" graphql:\"name\"" }{},
  },
  &gen.PlanetFragment{
    ID: "0x2f",
    Name: "Earth",
    Moons: []*struct { ID string "json:\"id\" graphql:\"id\""; Name string "json:\"name\" graphql:\"name\"" }{
      &struct { ID string "json:\"id\" graphql:\"id\""; Name string "json:\"name\" graphql:\"name\"" }{
        ID: "0x30",
        Name: "Moon",
      },
    },
  },
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages