Bug: Graphql codegen issue in checkout folder#1114
Bug: Graphql codegen issue in checkout folder#1114krunal-ss wants to merge 4 commits intosaleor:mainfrom
Conversation
|
@krunal-ss is attempting to deploy a commit to the Saleor Commerce Team on Vercel. A member of the Team first needs to authorize it. |
| "version": "0.1.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "license": "BSD-3-Clause", |
There was a problem hiding this comment.
please don't remove license from package.json 😄
package.json
Outdated
| "prebuild": "pnpm run generate", | ||
| "lint": "next lint --dir src --fix", | ||
| "generate": "graphql-codegen --config .graphqlrc.ts", | ||
| "generate": "DOTENV_CONFIG_PATH=.env graphql-codegen -r dotenv/config --config ./src/checkout/codegen.yml && graphql-codegen --config .graphqlrc.ts", |
There was a problem hiding this comment.
Suggestion: I would rather see you add additional config entry to existing .graphqlrc.ts instead of creating new config file.
There was a problem hiding this comment.
Added a new config. in .graphqlrc.ts and remove codegen.yml file
package.json
Outdated
| "@adyen/adyen-web": "5.53.3", | ||
| "@adyen/api-library": "15.0.0-beta", | ||
| "@headlessui/react": "1.7.18", | ||
| "@hookform/resolvers": "3.10.0", |
There was a problem hiding this comment.
Question: why those new dependencies are needed?
There was a problem hiding this comment.
Remove unwanted dependency as I was working with some new functionality.
| "src/checkout/graphql/index.ts": { | ||
| plugins: [ | ||
| { | ||
| add: { |
There was a problem hiding this comment.
Question: why do you need to add this?
// THIS FILE IS GENERATED WITH `pnpm generate`
import "graphql/language/ast"
Description
codegen) configuration was previously set to look for files only in thesrc/graphql/folder.src/checkout/graphql/*.graphqland worked only for thesrc/appfolder.Solution
codegenconfiguration will now also look into thesrc/checkout/graphql/folder.codegen.ymlfile and generate/modify theindex.tsfile insrc/checkout/graphql/.schema.graphql.jsonfile.