Skip to content

Commit

Permalink
Bugfix for wrong graphql type when using custom scalars in gqlgen
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed May 20, 2020
1 parent 66c3f47 commit 5b986ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func enhanceModelsWithFields(enums []*Enum, schema *ast.Schema, cfg *config.Conf
}
}

var ignoreTypePrefixes = []string{"graphql_models", "models"}
var ignoreTypePrefixes = []string{"graphql_models", "models", "boilergql"}

func getShortType(longType string) string {

Expand Down
7 changes: 5 additions & 2 deletions convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ package gqlgen_sqlboiler
import "testing"

func TestShortType(t *testing.T) {
testShortType(t, "gitlab.com/decicify/app/backend/graphql_models.FlowWhere", "FlowWhere")
testShortType(t, "*gitlab.com/decicify/app/backend/graphql_models.FlowWhere", "*FlowWhere")
testShortType(t, "gitlab.com/product/app/backend/graphql_models.FlowWhere", "FlowWhere")
testShortType(t, "*gitlab.com/product/app/backend/graphql_models.FlowWhere", "*FlowWhere")
testShortType(t, "*github.com/web-ridge/go-utils/boilergql/boilergql.GeoPoint", "*GeoPoint")
testShortType(t, "github.com/web-ridge/go-utils/boilergql/boilergql.GeoPoint", "GeoPoint")

testShortType(t, "*string", "*string")
testShortType(t, "string", "string")
testShortType(t, "*time.Time", "*time.Time")
Expand Down

0 comments on commit 5b986ef

Please sign in to comment.