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

KK-1065 | fix: fix "yarn generate:graphql" by using graphql-codegen #514

Merged
merged 1 commit into from Dec 21, 2023

Conversation

karisal-anders
Copy link
Contributor

@karisal-anders karisal-anders commented Dec 19, 2023

Description

fix: fix "yarn generate:graphql" by using graphql-codegen

now "yarn lint", "yarn typecheck", "yarn test" and
"yarn generate:graphql" all work and pass

some files were left over with broken types, disabled typechecking for
those files and marked them with FIXME comment

refs KK-1065

Context

KK-1065

How Has This Been Tested?

Manual Testing Instructions for Reviewers

Screenshots

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@karisal-anders karisal-anders marked this pull request as draft December 19, 2023 15:10
@terovirtanen
Copy link
Contributor

KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr514.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is failed for https://kukkuu-ui-pr514.dev.hel.ninja 😿💢💥💥

now "yarn lint", "yarn typecheck", "yarn test" and
"yarn generate:graphql" all work and pass

some files were left over with broken types, disabled typechecking for
those files and marked them with FIXME comment

refs KK-1065
@karisal-anders karisal-anders marked this pull request as ready for review December 20, 2023 15:09
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

Copy link

sonarcloud bot commented Dec 20, 2023

Quality Gate Failed Quality Gate failed

Failed conditions

13.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@terovirtanen
Copy link
Contributor

KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr514.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is failed for https://kukkuu-ui-pr514.dev.hel.ninja 😿💢💥💥

@karisal-anders
Copy link
Contributor Author

I'll refactor a bit so the types are easier to manage.

Copy link
Contributor

@nikomakela nikomakela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job. Some minor notes added.

Comment on lines +12 to +23
type ChildByIdQueryEnrolmentNodeOccurrence = NonNullable<
TypeByTypename<
NonNullable<
NonNullable<
NonNullable<
ChildByIdQuery['child']
>['activeInternalAndTicketSystemEnrolments']
>['edges'][number]
>['node'],
'EnrolmentNode'
>['occurrence']
>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😵

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a bit monstrous perhaps with the nested NonNullables etc. I'll refactor the types a bit in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring in #515

For example

type ChildByIdQueryEnrolmentNodeOccurrence = NonNullable<
  TypeByTypename<
    NonNullable<
      NonNullable<
        NonNullable<
          ChildByIdQuery['child']
        >['activeInternalAndTicketSystemEnrolments']
      >['edges'][number]
    >['node'],
    'EnrolmentNode'
  >['occurrence']
>;

export type InternalEnrolmentOccurrence = NonNullable<
  InternalEnrolment['occurrence']
>;

in ChildByIdQueryTypes.ts

@karisal-anders karisal-anders merged commit 4ea1fea into master Dec 21, 2023
48 of 51 checks passed
@karisal-anders karisal-anders deleted the KK-1065-fix-graphql-codegen branch December 21, 2023 09:12
nikomakela added a commit to City-of-Helsinki/kukkuu-admin that referenced this pull request Jan 22, 2024
KK-1076

The Apollo client codegen does not work with the current Node version.

Migration guide: https://www.rubrik.com/blog/architecture/23/6/migrating-apollo-codegen-to-graphQL-code-generator

Also took the changes done in Kukkuu-UI as an example:
- City-of-Helsinki/kukkuu-ui#514
- City-of-Helsinki/kukkuu-ui#515
- City-of-Helsinki/kukkuu-ui#516
nikomakela added a commit to City-of-Helsinki/kukkuu-admin that referenced this pull request Jan 24, 2024
KK-1076

The Apollo client codegen does not work with the current Node version.

Migration guide: https://www.rubrik.com/blog/architecture/23/6/migrating-apollo-codegen-to-graphQL-code-generator

Also took the changes done in Kukkuu-UI as an example:
- City-of-Helsinki/kukkuu-ui#514
- City-of-Helsinki/kukkuu-ui#515
- City-of-Helsinki/kukkuu-ui#516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants