Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from apollo cli to graphql-codegen to fix compatibility issues when generating types #1071

Open
ericstumper opened this issue Sep 10, 2024 · 1 comment
Assignees
Labels
chore Organiting or cleaning code

Comments

@ericstumper
Copy link
Contributor

apollographql/apollo-tooling#2053

@ericstumper ericstumper added the chore Organiting or cleaning code label Sep 10, 2024
@steffen74 steffen74 self-assigned this Sep 13, 2024
@ericstumper
Copy link
Contributor Author

ericstumper commented Sep 17, 2024

ToDos to check whether this new config is feasible for production use

Note: All graphql documents in the new graphql folder are already converted to the graphql-codegen syntax. this allows the codegen to infer fragments and subtypes without explicitly importing them and also allows us to omit the Query and QueryVariable typings in our useQuery and useMutation hooks, Typescript knows these query result types automatically from now on!

  • Move all components to new type structure, for example see all components in:
    • /components/pages/CourseContent/UploadAchievementRecord
  • Find out whether Fragment Masking is used in the best way possible (usage of useFrament is maybe too verbose or not needed?)
    • Does the result of useFragment have to be cached with useMemo?
    • Verbose import of Fragments seems tedious instead of just importing a type definition: import { ACHIEVEMENT_RECORD_FRAGMENT } from '../../../../graphql/fragments/achievementRecordFragment';
  • Test if the app with queries and mutations still runs smoothly
  • Check for type error with typescript by starting a build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Organiting or cleaning code
Projects
Status: In Progress
Development

No branches or pull requests

3 participants