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

Switch to graphql-codegen #2081

Merged

Conversation

andychow326
Copy link
Contributor

ref #1721

@andychow326
Copy link
Contributor Author

With newer version (>=8.3.1) of npm and Nodejs 16, there is a bug that
platform-specific optional dependencies not being included in package-lock.json.
Once these dependencies are not installed, the portal image cannot be built.
As parcel required @parcel/css, and @parcel/css required some of these dependencies,
at this moment this bug will occur, the workaround is to add
@parcel/css, lmdb and msgpackr-extract to the package.json
See npm/cli#4828

@@ -53,6 +53,7 @@
"chart.js": "3.7.0",
"chartjs-plugin-datalabels": "2.0.0",
"classnames": "2.3.1",
"core-js": "3.22.8",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Explicit polyfill is no longer needed.

@andychow326 andychow326 force-pushed the 1721-switch-to-graphql-codegen branch from f4c329a to c34898a Compare June 10, 2022 09:44
@louischan-oursky louischan-oursky self-requested a review June 10, 2022 10:33
Copy link
Collaborator

@louischan-oursky louischan-oursky left a comment

Choose a reason for hiding this comment

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

diff --git a/portal/graphql.adminapi.codegen.yaml b/portal/graphql.adminapi.codegen.yaml
index 25c42c7bd..89bd72e91 100644
--- a/portal/graphql.adminapi.codegen.yaml
+++ b/portal/graphql.adminapi.codegen.yaml
@@ -3,16 +3,12 @@ documents: "./src/graphql/adminapi/**/*.graphql"
 generates:
   ./src/graphql/adminapi/globalTypes.generated.ts:
     plugins:
-      - typescript
-      - typescript-operations
-      - typescript-react-apollo
-
+    - typescript
   ./src/graphql/adminapi/:
     preset: near-operation-file
     presetConfig:
       extension: .generated.ts
       baseTypesPath: ./globalTypes.generated.ts
     plugins:
-      - typescript
-      - typescript-operations
-      - typescript-react-apollo
+    - typescript-operations
+    - typescript-react-apollo

https://www.graphql-code-generator.com/docs/advanced/generated-files-colocation

According to the doc, we should configure the plugins this way so avoid duplicated generated code.

@andychow326 andychow326 force-pushed the 1721-switch-to-graphql-codegen branch from c34898a to e05e9f8 Compare June 10, 2022 10:54
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.

Switch from apollo to graphql-codegen
2 participants