Skip to content

Commit

Permalink
feat: add support for live queries (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbinz authored Sep 5, 2023
1 parent 99a8ca9 commit 807e9e9
Show file tree
Hide file tree
Showing 34 changed files with 1,426 additions and 293 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs linguist-documentation

examples/basic/gen linguist-generated
examples/movie/gen linguist-generated
examples/testing/gen linguist-generated
4 changes: 2 additions & 2 deletions core/codegen/base.builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (b *build) buildBaseFile(node *field.NodeTable) error {
// type {NodeName}Repo interface {...}
//
f.Type().Id(node.NameGo()+"Repo").Interface(
jen.Id("Query").Call().Qual(pkgQuery, node.NameGo()),
jen.Id("Query").Call().Qual(pkgQuery, "Node"+node.NameGo()),

jen.Id("Create").Call(
jen.Id("ctx").Qual("context", "Context"),
Expand Down Expand Up @@ -320,7 +320,7 @@ func (b *build) buildBaseFile(node *field.NodeTable) error {
f.Func().
Params(jen.Id("n").Op("*").Id(node.NameGoLower())).
Id("Query").Params().
Qual(pkgQuery, node.NameGo()).
Qual(pkgQuery, "Node"+node.NameGo()).
Block(
jen.Return(jen.Qual(pkgQuery, "New"+node.NameGo()).Call(
jen.Id("n").Dot("db"),
Expand Down
Loading

0 comments on commit 807e9e9

Please sign in to comment.