Skip to content

Commit

Permalink
fix: output directory for init command
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Apr 7, 2023
1 parent a75ce92 commit 86b972f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-bags-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': patch
---

fix the default output directory for init command
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/src/init/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function normalizeTargets(targets: Tags[] | Tags[][]): Tags[] {

export function getOutputDefaultValue(answers: Answers) {
if (answers.targets.includes(Tags.client)) {
return 'src/gql';
return 'src/gql/';
}
if (answers.plugins.some(plugin => plugin.defaultExtension === '.tsx')) {
return 'src/generated/graphql.tsx';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config: CodegenConfig = {
schema: "http://localhost:4000",
documents: "graphql/*.ts",
generates: {
"src/gql": {
"src/gql/": {
preset: "client",
plugins: []
},
Expand Down Expand Up @@ -51,7 +51,7 @@ const config: CodegenConfig = {
schema: "http://localhost:4000",
documents: "src/**/*.tsx",
generates: {
"src/gql": {
"src/gql/": {
preset: "client",
plugins: []
}
Expand Down Expand Up @@ -108,7 +108,7 @@ const config: CodegenConfig = {
schema: "http://localhost:4000",
documents: "src/**/*.tsx",
generates: {
"src/gql": {
"src/gql/": {
preset: "client",
plugins: []
}
Expand Down

0 comments on commit 86b972f

Please sign in to comment.