Skip to content

Commit

Permalink
fix: output directory for init command (#9280)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored Apr 20, 2023
1 parent 6c755db commit ca1d72c
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 ca1d72c

Please sign in to comment.