Skip to content

Commit

Permalink
type fix (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Sep 28, 2022
1 parent 61856a2 commit 39606b9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions internal/graphql/custom_ts.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,26 @@ func processFields(processor *codegen.Processor, cd *CustomData, s *gqlSchema, c
// TODO for now we assume inputtype is 1:1, that's not going to remain the same forever...
argObj := cr.getArgObject(cd, arg)
typ := knownTsTypes[arg.Type]
// TODO use input.Field.GetEntType()
if typ == "" {
typ = "any"
} else {
if arg.Connection {
typ = "any"
} else {
if arg.List {
typ = typ + "[]"
}
if arg.Nullable == NullableTrue {
typ = typ + " | null"
}
}
}
if argObj == nil {
createInterface = true
intType.Fields = append(intType.Fields, &interfaceField{
Name: arg.Name,
Type: typ,
Optional: arg.Nullable != "",
Name: arg.Name,
Type: typ,
//
// arg.TSType + add to import so we can useImport
// UseImport: true,
Expand Down

0 comments on commit 39606b9

Please sign in to comment.