diff --git a/ent/entc.go b/ent/entc.go index 00b9ce6..158a183 100644 --- a/ent/entc.go +++ b/ent/entc.go @@ -12,10 +12,10 @@ import ( func main() { ex, err := entgql.NewExtension( + entgql.WithWhereInputs(true), entgql.WithConfigPath("./gqlgen.yml"), entgql.WithSchemaGenerator(), - entgql.WithSchemaPath("./ent.graphql"), - entgql.WithWhereInputs(true), + entgql.WithSchemaPath("./graph/ent.graphql"), ) if err != nil { log.Fatalf("creating entgql extension: %v", err) diff --git a/go.mod b/go.mod index 5b94776..8bbe7e3 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module code.icod.de/dalu/ka go 1.23.1 require ( + entgo.io/contrib v0.6.0 entgo.io/ent v0.14.1 github.com/99designs/gqlgen v0.17.55 github.com/google/uuid v1.6.0 @@ -25,16 +26,15 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.15.0 // indirect - golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/text v0.19.0 // indirect - golang.org/x/tools v0.25.0 // indirect + golang.org/x/tools v0.26.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( - entgo.io/contrib v0.6.0 github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 // indirect diff --git a/go.sum b/go.sum index 50a29fa..3f6fe7d 100644 --- a/go.sum +++ b/go.sum @@ -77,16 +77,16 @@ github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 h1:1wqE9dj9NpSm04INVsJhhEUzhuDVjbcyKH91sVyPATw= +golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= -golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/gqlgen.yml b/gqlgen.yml index 1160bf9..3ecf673 100644 --- a/gqlgen.yml +++ b/gqlgen.yml @@ -1,7 +1,7 @@ # schema tells gqlgen when the GraphQL schema is located. schema: - - ent.graphql - - ka.graphql + - graph/ent.graphql + - graph/ka.graphql # Where should the generated server code go? exec: @@ -35,4 +35,4 @@ models: - code.icod.de/dalu/ka/ent/schema/uuidgql.UUID Node: model: - - code.icod.de/dalu/ka/ent.Noder \ No newline at end of file + - code.icod.de/dalu/ka/ent.Noder diff --git a/ent.graphql b/graph/ent.graphql similarity index 100% rename from ent.graphql rename to graph/ent.graphql diff --git a/graph/generated/root_.generated.go b/graph/generated/root_.generated.go index f7d22bc..e2d2446 100644 --- a/graph/generated/root_.generated.go +++ b/graph/generated/root_.generated.go @@ -600,7 +600,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - {Name: "../../ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + {Name: "../ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type Category implements Node { id: ID! diff --git a/main.go b/main.go index a7adcc7..8e68520 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,9 @@ -/* -Copyright © 2024 Darko Luketic - -*/ package main -import "code.icod.de/dalu/ka/cmd" +import ( + "code.icod.de/dalu/ka/cmd" + _ "code.icod.de/dalu/ka/ent/runtime" +) func main() { cmd.Execute()