Skip to content

Commit

Permalink
Fix name clashes in resolvers-types.ts with a hack
Browse files Browse the repository at this point in the history
I modified indent_style back to "space" in .editorconfig to avoid too
much changes in this commit's diff.

We still have the following problem: "error TS5053: Option 'noEmit'
cannot be specified with option 'composite'."
  • Loading branch information
iquabius committed Jun 17, 2020
1 parent 197aa18 commit 8577eb8
Show file tree
Hide file tree
Showing 2 changed files with 590 additions and 426 deletions.
26 changes: 16 additions & 10 deletions packages/api/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ generates:
avoidOptionals: true
contextType: ../utils#OliContext
# Corresponding mapped types should be excluded from generated file
# since they're imported from prisma-client
# since they're imported from prisma-client. But it doesn't look possible.
# So we add a suffix to the imported names to prevent name clashes.
# mapperTypeSuffix: Model
# But it's not supported until v1.13.0
# https://github.com/dotansimha/graphql-code-generator/releases/tag/v1.13.0
# So make this hack for now, as per:
# https://github.com/dotansimha/graphql-code-generator/issues/2932#issuecomment-552910765
mappers:
City: ./prisma-client#City
# Node: ./prisma-client#Node
Olympiad: ./prisma-client#Olympiad
OlympiadConnection: ./prisma-client#OlympiadConnection
Question: ./prisma-client#Question
QuestionConnection: ./prisma-client#QuestionConnection
School: ./prisma-client#School
Exam: ./prisma-client#Exam
User: ./prisma-client#User
City: import('./prisma-client').City
# Node: import('./prisma-client').Node
Olympiad: import('./prisma-client').Olympiad
OlympiadConnection: import('./prisma-client').OlympiadConnection
Question: import('./prisma-client').Question
QuestionConnection: import('./prisma-client').QuestionConnection
School: import('./prisma-client').School
Exam: import('./prisma-client').Exam
User: import('./prisma-client').User
plugins:
- "typescript-common"
- "typescript-server"
Expand Down
Loading

0 comments on commit 8577eb8

Please sign in to comment.