Skip to content

Commit

Permalink
fix: test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dosco committed Jan 2, 2023
1 parent 6f882e5 commit f09aac8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ tidy:

test:
@go test -v -timeout 50m -race ./...
@go test -v -timeout 50m -race -db=mysql -tags=mysql ./...
@cd core; go test -v -timeout 50m -race -db=mysql -tags=mysql ./...

test-norace:
@go test -v -timeout 50m ./...
@go test -v -timeout 50m -db=mysql -tags=mysql ./...
@go test -v -timeout 50m ./... && go test -v -timeout 50m -db=mysql -tags=mysql ./...

BIN_DIR := $(GOPATH)/bin
WEB_BUILD_DIR := ./serv/web/build/manifest.json
Expand Down
7 changes: 4 additions & 3 deletions core/internal/psql/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ func (c *compilerContext) renderColumns(sel *qcode.Select) {
if i != 0 {
c.w.WriteString(", ")
}
if f.SkipRender == qcode.SkipTypeDrop {
continue
}
if f.Type == qcode.FieldTypeFunc {
c.renderFuncColumn(sel, f)
} else {
Expand Down Expand Up @@ -98,6 +95,10 @@ func (c *compilerContext) renderJoinColumns(sel *qcode.Select, n int) {
}
i++
}
// when no columns are rendered for mysql
if c.ct == "mysql" && i == 0 {
c.w.WriteString(`NULL`)
}
}

func (c *compilerContext) renderUnionColumn(sel, csel *qcode.Select) {
Expand Down
20 changes: 16 additions & 4 deletions core/internal/qcode/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ func (co *Compiler) compileChildColumns(
field.Func = fn.Func
field.Args = fn.Args

if err := co.compileFieldDirectives(sel, &field, f.Directives, role); err != nil {
return err
}

if field.SkipRender == SkipTypeDrop {
continue
}

if err := co.compileFuncArgs(sel, &field, f.Args); err != nil {
return err
}
Expand All @@ -111,6 +119,14 @@ func (co *Compiler) compileChildColumns(
return err
}

if err := co.compileFieldDirectives(sel, &field, f.Directives, role); err != nil {
return err
}

if field.SkipRender == SkipTypeDrop {
continue
}

if field.Col.Blocked {
return fmt.Errorf("column: '%s.%s.%s' blocked",
field.Col.Schema,
Expand All @@ -119,10 +135,6 @@ func (co *Compiler) compileChildColumns(
}
}

if err := co.compileFieldDirectives(sel, &field, f.Directives, role); err != nil {
return err
}

sel.addField(field)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphjin",
"version": "2.0.17",
"version": "2.0.18",
"description": "GraphJin - Build APIs in 5 minutes with GraphQL",
"type": "module",
"main": "./wasm/js/graphjin.js",
Expand Down

1 comment on commit f09aac8

@vercel
Copy link

@vercel vercel bot commented on f09aac8 Jan 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.