Skip to content

Commit ce7055a

Browse files
committed
config property renamed
1 parent 0e39eb0 commit ce7055a

File tree

8 files changed

+55
-55
lines changed

8 files changed

+55
-55
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
8080
### graphql-codegen-hasura-gql-documents plugin
8181

8282
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
83-
- typescriptCodegenOutputRelativePath: import path to the code generated with dependent @graphql-codegen/typescript generated code
83+
- typescriptCodegenOutputPath: import path to the code generated with dependent @graphql-codegen/typescript generated code
8484
- withQueries: boolean flag for query TypeScript code generation
8585
- withInserts: boolean flag for insert TypeScript code generation
8686
- withUpdates: boolean flag for update TypeScript code generation
@@ -89,7 +89,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
8989
### graphql-codegen-hasura-typescript-schema plugin
9090

9191
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
92-
- typescriptCodegenOutputRelativePath: import path to the code generated with dependent @graphql-codegen/typescript generated code
92+
- typescriptCodegenOutputPath: import path to the code generated with dependent @graphql-codegen/typescript generated code
9393
- trimString: optional string to trim from each type name. Useful for trimming Hasura prepended schema name
9494
- withQueries: boolean flag for query TypeScript code generation
9595
- withInserts: boolean flag for insert TypeScript code generation
@@ -99,7 +99,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
9999
### graphql-codegen-hasura-typescript-documents plugin
100100

101101
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
102-
- typescriptCodegenOutputRelativePath: import path to the code generated with dependent @graphql-codegen/typescript generated code
102+
- typescriptCodegenOutputPath: import path to the code generated with dependent @graphql-codegen/typescript generated code
103103
- trimString: optional string to trim from each type name. Useful for trimming Hasura prepended schema name
104104
- withQueries: boolean flag for query TypeScript code generation
105105
- withInserts: boolean flag for insert TypeScript code generation

demo/graphql-codegen-gql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ generates:
2424
- ./src/customFragments.ts
2525
config:
2626
reactApolloVersion: 3
27-
typescriptCodegenOutputRelativePath: ../
27+
typescriptCodegenOutputPath: ../
2828
withQueries: true
2929
withInserts: true
3030
withUpdates: true

demo/graphql-codegen-typescript.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ generates:
2626
- graphql-codegen-hasura-typescript-from-schema
2727
config:
2828
reactApolloVersion: 3
29-
typescriptCodegenOutputRelativePath: "../"
29+
typescriptCodegenOutputPath: "../"
3030
withQueries: true
3131
withInserts: true
3232
withUpdates: true
@@ -38,7 +38,7 @@ generates:
3838
- graphql-codegen-hasura-typescript-from-documents
3939
config:
4040
reactApolloVersion: 3
41-
typescriptCodegenOutputRelativePath: "../"
41+
typescriptCodegenOutputPath: "../"
4242
trimstring:
4343
withQueries: true
4444
withInserts: true

packages/graphql-codegen-hasura-gql-from-documents/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getPrimaryKeyIdField, injectDeleteGql, injectFetchGql, injectFragmentIm
1010

1111
export interface CstmHasuraCrudPluginConfig extends RawTypesConfig {
1212
reactApolloVersion?: number;
13-
typescriptCodegenOutputRelativePath?: string;
13+
typescriptCodegenOutputPath?: string;
1414
trimString?: string;
1515
withQueries?: boolean;
1616
withInserts?: boolean;
@@ -73,7 +73,7 @@ function makeEntityModelSharedGql(
7373
//------------------------------------------------
7474
`);
7575

76-
if (config.typescriptCodegenOutputRelativePath) injectFragmentImport({ importArray, fragmentName, fragmentRelativeImportPath: config.typescriptCodegenOutputRelativePath });
76+
if (config.typescriptCodegenOutputPath) injectFragmentImport({ importArray, fragmentName, fragmentRelativeImportPath: config.typescriptCodegenOutputPath });
7777
}
7878

7979
// --------------------------------------

packages/graphql-codegen-hasura-gql-from-schema/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121

2222
export interface CstmHasuraCrudPluginConfig extends RawTypesConfig {
2323
reactApolloVersion?: number;
24-
typescriptCodegenOutputRelativePath?: string;
24+
typescriptCodegenOutputPath?: string;
2525
trimString?: string;
2626
withFragments?: boolean;
2727
withQueries?: boolean;
@@ -72,7 +72,7 @@ function makeEntityModelSharedGql(namedType: GraphQLNamedType, importArray: stri
7272
`);
7373

7474
const fragmentName = makeFragmentName(entityName, config.trimString);
75-
if (config.typescriptCodegenOutputRelativePath) injectFragmentImport({ importArray, fragmentName, fragmentRelativeImportPath: config.typescriptCodegenOutputRelativePath });
75+
if (config.typescriptCodegenOutputPath) injectFragmentImport({ importArray, fragmentName, fragmentRelativeImportPath: config.typescriptCodegenOutputPath });
7676
}
7777

7878
function makeEntityModelFragmentsGql(namedType: GraphQLNamedType, importArray: string[], contentArray: string[], config: CstmHasuraCrudPluginConfig) {

packages/graphql-codegen-hasura-typescript-from-documents/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getPrimaryKeyIdField, injectDeleteHelpers, injectFetchHelpers, injectIn
1010

1111
export interface CstmHasuraCrudPluginConfig extends RawTypesConfig {
1212
reactApolloVersion?: number;
13-
typescriptCodegenOutputRelativePath: string;
13+
typescriptCodegenOutputPath: string;
1414
trimString?: string;
1515
withQueries?: boolean;
1616
withInserts?: boolean;
@@ -80,7 +80,7 @@ function makeEntitySharedTypeScript(
8080
fragmentName,
8181
trimString: config.trimString,
8282
primaryKeyIdField: relatedTablePrimaryKeyIdField,
83-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
83+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
8484
});
8585
}
8686
// --------------------------------------
@@ -107,7 +107,7 @@ function makeEntityQueryMutationTypeScript(
107107
fragmentName,
108108
trimString: config.trimString,
109109
primaryKeyIdField: relatedTablePrimaryKeyIdField,
110-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
110+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
111111
});
112112
}
113113

@@ -135,7 +135,7 @@ function makeEntityInsertMutationTypeScript(
135135
fragmentName,
136136
trimString: config.trimString,
137137
primaryKeyIdField: relatedTablePrimaryKeyIdField,
138-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
138+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
139139
});
140140
}
141141
// --------------------------------------
@@ -162,7 +162,7 @@ function makeEntityUpdateMutationTypeScript(
162162
fragmentName,
163163
trimString: config.trimString,
164164
primaryKeyIdField: relatedTablePrimaryKeyIdField,
165-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
165+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
166166
});
167167
}
168168

@@ -190,7 +190,7 @@ function makeEntityDeleteMutationTypeScript(
190190
fragmentName,
191191
trimString: config.trimString,
192192
primaryKeyIdField: relatedTablePrimaryKeyIdField,
193-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
193+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
194194
});
195195
}
196196

packages/graphql-codegen-hasura-typescript-from-schema/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818

1919
export interface CstmHasuraCrudPluginConfig extends RawTypesConfig {
2020
reactApolloVersion?: number;
21-
typescriptCodegenOutputRelativePath: string;
21+
typescriptCodegenOutputPath: string;
2222
trimString?: string;
2323
withQueries?: boolean;
2424
withInserts?: boolean;
@@ -72,7 +72,7 @@ function makeEntitySharedTypeScript(namedType: GraphQLNamedType, importArray: st
7272
fragmentName,
7373
trimString: config.trimString,
7474
primaryKeyIdField,
75-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
75+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
7676
});
7777
}
7878
// --------------------------------------
@@ -91,7 +91,7 @@ function makeEntityQueryMutationTypeScript(namedType: GraphQLNamedType, importAr
9191
fragmentName,
9292
trimString: config.trimString,
9393
primaryKeyIdField,
94-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
94+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
9595
});
9696
}
9797

@@ -111,7 +111,7 @@ function makeEntityInsertMutationTypeScript(namedType: GraphQLNamedType, importA
111111
fragmentName,
112112
trimString: config.trimString,
113113
primaryKeyIdField,
114-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
114+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
115115
});
116116
}
117117
// --------------------------------------
@@ -130,7 +130,7 @@ function makeEntityUpdateMutationTypeScript(namedType: GraphQLNamedType, importA
130130
fragmentName,
131131
trimString: config.trimString,
132132
primaryKeyIdField,
133-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
133+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
134134
});
135135
}
136136

@@ -150,7 +150,7 @@ function makeEntityDeleteMutationTypeScript(namedType: GraphQLNamedType, importA
150150
fragmentName,
151151
trimString: config.trimString,
152152
primaryKeyIdField,
153-
typescriptCodegenOutputRelativePath: config.typescriptCodegenOutputRelativePath
153+
typescriptCodegenOutputPath: config.typescriptCodegenOutputPath
154154
});
155155
}
156156

packages/shared/helperInjectors.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export function injectSharedHelpers({
1111
fragmentName,
1212
trimString,
1313
primaryKeyIdField,
14-
typescriptCodegenOutputRelativePath
14+
typescriptCodegenOutputPath
1515
}: {
1616
contentArray: string[];
1717
importArray: string[];
1818
entityName: string;
1919
fragmentName: string;
2020
trimString?: string;
2121
primaryKeyIdField: FieldDefinitionNode;
22-
typescriptCodegenOutputRelativePath: string;
22+
typescriptCodegenOutputPath: string;
2323
}) {
2424
const primaryKeyIdTypeScriptFieldType = getIdTypeScriptFieldType(primaryKeyIdField);
2525

@@ -29,14 +29,14 @@ export function injectSharedHelpers({
2929
`);
3030

3131
if (!primaryKeyIdTypeScriptFieldType.isNative) {
32-
const typeImport = makeImportStatement(`${primaryKeyIdTypeScriptFieldType.typeName}`, typescriptCodegenOutputRelativePath);
32+
const typeImport = makeImportStatement(`${primaryKeyIdTypeScriptFieldType.typeName}`, typescriptCodegenOutputPath);
3333
if (!importArray.includes(typeImport)) {
3434
importArray.push(typeImport);
3535
}
3636
}
3737

3838
const fragmentTypeScriptTypeName = makeFragmentTypeScriptTypeName(fragmentName);
39-
importArray.push(makeImportStatement(fragmentTypeScriptTypeName, typescriptCodegenOutputRelativePath));
39+
importArray.push(makeImportStatement(fragmentTypeScriptTypeName, typescriptCodegenOutputPath));
4040
}
4141

4242
// ---------------------------------
@@ -48,15 +48,15 @@ export function injectFetchHelpers({
4848
fragmentName,
4949
trimString,
5050
primaryKeyIdField,
51-
typescriptCodegenOutputRelativePath
51+
typescriptCodegenOutputPath
5252
}: {
5353
contentArray: string[];
5454
importArray: string[];
5555
entityName: string;
5656
fragmentName: string;
5757
trimString?: string;
5858
primaryKeyIdField: FieldDefinitionNode;
59-
typescriptCodegenOutputRelativePath: string;
59+
typescriptCodegenOutputPath: string;
6060
}) {
6161
const entityShortCamelCaseName = makeShortCamelCaseName(entityName, trimString);
6262
const entityModelName = makeModelName(entityName, trimString);
@@ -83,11 +83,11 @@ export function injectFetchHelpers({
8383
return ${entityShortCamelCaseName}Result.data.${entityName};
8484
}
8585
`);
86-
importArray.push(makeImportStatement(`Fetch${fragmentName}ByIdQuery`, typescriptCodegenOutputRelativePath));
87-
importArray.push(makeImportStatement(`Fetch${fragmentName}ByIdDocument`, typescriptCodegenOutputRelativePath));
88-
importArray.push(makeImportStatement(`Fetch${fragmentName}Query`, typescriptCodegenOutputRelativePath));
89-
importArray.push(makeImportStatement(`Fetch${fragmentName}Document`, typescriptCodegenOutputRelativePath));
90-
importArray.push(makeImportStatement(`Fetch${fragmentName}QueryVariables`, typescriptCodegenOutputRelativePath));
86+
importArray.push(makeImportStatement(`Fetch${fragmentName}ByIdQuery`, typescriptCodegenOutputPath));
87+
importArray.push(makeImportStatement(`Fetch${fragmentName}ByIdDocument`, typescriptCodegenOutputPath));
88+
importArray.push(makeImportStatement(`Fetch${fragmentName}Query`, typescriptCodegenOutputPath));
89+
importArray.push(makeImportStatement(`Fetch${fragmentName}Document`, typescriptCodegenOutputPath));
90+
importArray.push(makeImportStatement(`Fetch${fragmentName}QueryVariables`, typescriptCodegenOutputPath));
9191
}
9292

9393
// ---------------------------------
@@ -99,15 +99,15 @@ export function injectInsertHelpers({
9999
fragmentName,
100100
trimString,
101101
primaryKeyIdField,
102-
typescriptCodegenOutputRelativePath
102+
typescriptCodegenOutputPath
103103
}: {
104104
contentArray: string[];
105105
importArray: string[];
106106
entityName: string;
107107
fragmentName: string;
108108
trimString?: string;
109109
primaryKeyIdField: FieldDefinitionNode;
110-
typescriptCodegenOutputRelativePath: string;
110+
typescriptCodegenOutputPath: string;
111111
}) {
112112
const entityShortCamelCaseName = makeShortCamelCaseName(entityName, trimString);
113113
const entityModelName = makeModelName(entityName, trimString);
@@ -130,9 +130,9 @@ export function injectInsertHelpers({
130130
}
131131
`);
132132

133-
importArray.push(makeImportStatement(`Insert${fragmentName}Mutation`, typescriptCodegenOutputRelativePath));
134-
importArray.push(makeImportStatement(`Insert${fragmentName}MutationVariables`, typescriptCodegenOutputRelativePath));
135-
importArray.push(makeImportStatement(`Insert${fragmentName}Document`, typescriptCodegenOutputRelativePath));
133+
importArray.push(makeImportStatement(`Insert${fragmentName}Mutation`, typescriptCodegenOutputPath));
134+
importArray.push(makeImportStatement(`Insert${fragmentName}MutationVariables`, typescriptCodegenOutputPath));
135+
importArray.push(makeImportStatement(`Insert${fragmentName}Document`, typescriptCodegenOutputPath));
136136
}
137137

138138
// ---------------------------------
@@ -144,15 +144,15 @@ export function injectUpdateHelpers({
144144
fragmentName,
145145
trimString,
146146
primaryKeyIdField,
147-
typescriptCodegenOutputRelativePath
147+
typescriptCodegenOutputPath
148148
}: {
149149
contentArray: string[];
150150
importArray: string[];
151151
entityName: string;
152152
fragmentName: string;
153153
trimString?: string;
154154
primaryKeyIdField: FieldDefinitionNode;
155-
typescriptCodegenOutputRelativePath: string;
155+
typescriptCodegenOutputPath: string;
156156
}) {
157157
const entityShortName = makeShortName(entityName);
158158
const entityShortCamelCaseName = makeShortCamelCaseName(entityName, trimString);
@@ -192,13 +192,13 @@ export function injectUpdateHelpers({
192192
}
193193
`);
194194

195-
importArray.push(makeImportStatement(`${entityShortName}_Set_Input`, typescriptCodegenOutputRelativePath));
196-
importArray.push(makeImportStatement(`Update${fragmentName}ByIdMutation`, typescriptCodegenOutputRelativePath));
197-
importArray.push(makeImportStatement(`Update${fragmentName}ByIdMutationVariables`, typescriptCodegenOutputRelativePath));
198-
importArray.push(makeImportStatement(`Update${fragmentName}ByIdDocument`, typescriptCodegenOutputRelativePath));
199-
importArray.push(makeImportStatement(`Update${fragmentName}Mutation`, typescriptCodegenOutputRelativePath));
200-
importArray.push(makeImportStatement(`Update${fragmentName}MutationVariables`, typescriptCodegenOutputRelativePath));
201-
importArray.push(makeImportStatement(`Update${fragmentName}Document`, typescriptCodegenOutputRelativePath));
195+
importArray.push(makeImportStatement(`${entityShortName}_Set_Input`, typescriptCodegenOutputPath));
196+
importArray.push(makeImportStatement(`Update${fragmentName}ByIdMutation`, typescriptCodegenOutputPath));
197+
importArray.push(makeImportStatement(`Update${fragmentName}ByIdMutationVariables`, typescriptCodegenOutputPath));
198+
importArray.push(makeImportStatement(`Update${fragmentName}ByIdDocument`, typescriptCodegenOutputPath));
199+
importArray.push(makeImportStatement(`Update${fragmentName}Mutation`, typescriptCodegenOutputPath));
200+
importArray.push(makeImportStatement(`Update${fragmentName}MutationVariables`, typescriptCodegenOutputPath));
201+
importArray.push(makeImportStatement(`Update${fragmentName}Document`, typescriptCodegenOutputPath));
202202
}
203203

204204
// ---------------------------------
@@ -210,15 +210,15 @@ export function injectDeleteHelpers({
210210
fragmentName,
211211
trimString,
212212
primaryKeyIdField,
213-
typescriptCodegenOutputRelativePath
213+
typescriptCodegenOutputPath
214214
}: {
215215
contentArray: string[];
216216
importArray: string[];
217217
entityName: string;
218218
fragmentName: string;
219219
trimString?: string;
220220
primaryKeyIdField: FieldDefinitionNode;
221-
typescriptCodegenOutputRelativePath: string;
221+
typescriptCodegenOutputPath: string;
222222
}) {
223223
const entityShortCamelCaseName = makeShortCamelCaseName(entityName, trimString);
224224
const entityModelName = makeModelName(entityName, trimString);
@@ -256,10 +256,10 @@ export function injectDeleteHelpers({
256256
}
257257
`);
258258

259-
importArray.push(makeImportStatement(`Remove${entityModelName}Mutation`, typescriptCodegenOutputRelativePath));
260-
importArray.push(makeImportStatement(`Remove${entityModelName}MutationVariables`, typescriptCodegenOutputRelativePath));
261-
importArray.push(makeImportStatement(`Remove${entityModelName}Document`, typescriptCodegenOutputRelativePath));
262-
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdMutation`, typescriptCodegenOutputRelativePath));
263-
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdMutationVariables`, typescriptCodegenOutputRelativePath));
264-
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdDocument`, typescriptCodegenOutputRelativePath));
259+
importArray.push(makeImportStatement(`Remove${entityModelName}Mutation`, typescriptCodegenOutputPath));
260+
importArray.push(makeImportStatement(`Remove${entityModelName}MutationVariables`, typescriptCodegenOutputPath));
261+
importArray.push(makeImportStatement(`Remove${entityModelName}Document`, typescriptCodegenOutputPath));
262+
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdMutation`, typescriptCodegenOutputPath));
263+
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdMutationVariables`, typescriptCodegenOutputPath));
264+
importArray.push(makeImportStatement(`Remove${entityModelName}ByIdDocument`, typescriptCodegenOutputPath));
265265
}

0 commit comments

Comments
 (0)