Open bombnp opened 1 year ago
libs/codegen
) that read backend's graphql schema and generate types/documents/react hookslibs/codegen
In this ticket, I would like to split PR into 2 (or more part) for easier reviewing. Sub-PRs are independent and can be merged separately.
libs/codegen
, generate GraphQL types and documents from cugetreg-api
's GraphQL schemas.cugetreg-web
) queries to use generated type from libs/codegen
@thinc-org/chula-courses
from dependencies@Leomotors since we're not using Nx anymore, does codegen still work? The generated code is probably fine, but the action to generate it required Nx right?
@Leomotors since we're not using Nx anymore, does codegen still work? The generated code is probably fine, but the action to generate it required Nx right?
We need to convert the command into turbo way. Which is not that complex.
Is your feature request related to a problem? Please describe. Both
cugetreg-web
andcugetreg-api
have separate type definitions for GraphQL types (cugetreg-api
= auto-generated from .graphql files,cugetreg-web
= manual declaration). This mean changes tocugetreg-api
'schema can break withoutcugetreg-web
realizing it.cugetreg-api
andcu-scraper
both connects to MongoDB to access course data. The mongo schema is currently separated as well, and we need to change both of them when we make changes to the database schema.Describe the solution you'd like
schema
to act as a single source of type declaration between multiple projects (mostly frontend and backend). For GraphQL types, utilize auto-generated types from .graphql files for both projects. Note: this will require heavy refactoring on the frontend code.cugetreg-api
andcu-scraper
cugetreg-api
andcugetreg-web
cugetreg-api
to this project, to share withcu-scraper
(after we migrate scraper to this repo)Additional context
Don't worry about
cu-scraper
for now as it may be deprecated in favor of new implementation soon.Task Advisor @bombnp