Skip to content

Commit 339748c

Browse files
committed
chore: set generateHTTPClient to true by default to avoid a breaking change
1 parent 37e22b5 commit 339748c

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

graphql.config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ projects:
99
hooks:
1010
afterOneFileWrite: go fmt
1111
plugins:
12-
- packages/graphql-codegen-golang/dist/index.js
12+
- packages/graphql-codegen-golang/dist/index.js:
13+
generateHTTPClient: false
1314
rickandmorty:
1415
schema: https://rickandmortyapi.com/graphql/
1516
documents: examples/rickandmorty/document.graphql
@@ -22,4 +23,3 @@ projects:
2223
plugins:
2324
- packages/graphql-codegen-golang/dist/index.js:
2425
packageName: rickandmorty
25-
generateHTTPClient: true

packages/graphql-codegen-golang/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ generates:
3838
plugins:
3939
- graphql-codegen-golang:
4040
packageName: graphql # default
41-
generateHTTPClient: false # default
41+
generateHTTPClient: true # default
4242
```
4343
4444
See [`graphql.config.yaml`](/graphql.config.yaml) for more.
@@ -50,4 +50,4 @@ Configuration source is at [src/config.ts](src/config.ts)
5050
| Name | Type | Default | Description |
5151
| ------------------ | ------- | ------- | ------------------------------------------ |
5252
| packageName | string | graphql | Name of the generated Golang package. |
53-
| generateHTTPClient | boolean | false | Should an GraphQL HTTP client be generated |
53+
| generateHTTPClient | boolean | true | Should an GraphQL HTTP client be generated |

packages/graphql-codegen-golang/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface IGolangPluginConfig {
1515

1616
/**
1717
* Define if an HTTP client should be generated
18-
* @default false
18+
* @default true
1919
*/
2020
generateHTTPClient?: boolean
2121
}

packages/graphql-codegen-golang/src/generator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export class GolangGenerator {
6262

6363
public constructor(schema: GraphQLSchema, config?: IGolangPluginConfig) {
6464
this.config = config ?? {}
65+
this.config.generateHTTPClient ??= true
6566
this.schema = schema
6667
this._templateEngine = new Liquid({
6768
strictFilters: true,

0 commit comments

Comments
 (0)