Skip to content

Commit

Permalink
fix(cli): typo in @graphql-codegen/client-preset install (#8427)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Oct 3, 2022
1 parent d473867 commit 5524ac4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-rivers-beam.md
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

Fix issue with `graphql-codegen init` installation wizard
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/init/helpers.ts
Expand Up @@ -103,7 +103,7 @@ export async function writePackage(answers: Answers, configLocation: string) {

pkg.devDependencies['@graphql-codegen/cli'] = await getLatestVersion('@graphql-codegen/cli');
if (answers.targets.includes(Tags.client)) {
pkg.devDependencies['@graphql-codegen/client'] = await getLatestVersion('@graphql-codegen/client');
pkg.devDependencies['@graphql-codegen/client-preset'] = await getLatestVersion('@graphql-codegen/client-preset');
}

writeFileSync(pkgPath, JSON.stringify(pkg, null, indent));
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/tests/init.spec.ts
Expand Up @@ -196,7 +196,7 @@ describe('init', () => {

// expected plugins
expect(pkg.devDependencies).toHaveProperty('@graphql-codegen/cli');
expect(pkg.devDependencies).toHaveProperty('@graphql-codegen/client');
expect(pkg.devDependencies).toHaveProperty('@graphql-codegen/client-preset');
// should not have other plugins
expect(Object.keys(pkg.devDependencies)).toHaveLength(2);
});
Expand Down

0 comments on commit 5524ac4

Please sign in to comment.