Skip to content

Commit

Permalink
fix generated date types (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Mar 2, 2024
1 parent dfe1edb commit 1f99850
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 33 deletions.
19 changes: 11 additions & 8 deletions examples/ent-rsvp/backend/src/graphql/generated/schema.gql

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

43 changes: 23 additions & 20 deletions examples/simple/src/graphql/generated/schema.gql

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

9 changes: 6 additions & 3 deletions examples/todo-sqlite/src/graphql/generated/schema.gql

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

8 changes: 6 additions & 2 deletions internal/graphql/generate_ts_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ func (p *TSStep) Name() string {
return "graphql"
}

// note Date here is intentionally commented out
// adding it to knownTypes kills the scalar Time and changes all
// GraphQL Time to Date
// TODO figure out exactly what's happening here...
var knownTypes = map[string]*tsimport.ImportPath{
"String": tsimport.NewGQLImportPath("GraphQLString"),
"Date": tsimport.NewEntGraphQLImportPath("GraphQLTime"),
"String": tsimport.NewGQLImportPath("GraphQLString"),
// "Date": tsimport.NewEntGraphQLImportPath("GraphQLTime"),
"Int": tsimport.NewGQLImportPath("GraphQLInt"),
"Float": tsimport.NewGQLImportPath("GraphQLFloat"),
"Boolean": tsimport.NewGQLImportPath("GraphQLBoolean"),
Expand Down

0 comments on commit 1f99850

Please sign in to comment.