Skip to content

Commit 01789e5

Browse files
committed
generates without errors
1 parent a079f47 commit 01789e5

File tree

15 files changed

+212
-958
lines changed

15 files changed

+212
-958
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
5858
### graphql-codegen-hasura-gql-from-schema plugin
5959

6060
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
61-
- fragmentImportFrom: import path to the gql fragment generated code. Only required if withFragments:false
61+
- fragmentRelativeImportPath: import path to the gql fragment generated code. Only required if withFragments:false
6262
- trimString: optional string to trim from each type name. Useful for trimming Hasura prepended schema name
6363
- withFragments: boolean flag for fragment gql code generation
6464
- withQueries: boolean flag for query gql code generation
@@ -69,7 +69,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
6969
### graphql-codegen-hasura-typescript-schema plugin
7070

7171
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
72-
- primaryCodegenTypeScriptImportPath: import path to the code generated with dependent @graphql-codegen/typescript generated code
72+
- typescriptCodegenOutputRelativePath: import path to the code generated with dependent @graphql-codegen/typescript generated code
7373
- trimString: optional string to trim from each type name. Useful for trimming Hasura prepended schema name
7474
- withQueries: boolean flag for query TypeScript code generation
7575
- withInserts: boolean flag for insert TypeScript code generation
@@ -79,7 +79,7 @@ See [graphql-code-generator documentation](https://graphql-code-generator.com/do
7979
### graphql-codegen-hasura-typescript-documents plugin
8080

8181
- reactApolloVersion (2 | 3, default value: 3): sets the version of react-apollo
82-
- primaryCodegenTypeScriptImportPath: import path to the code generated with dependent @graphql-codegen/typescript generated code
82+
- typescriptCodegenOutputRelativePath: import path to the code generated with dependent @graphql-codegen/typescript generated code
8383
- trimString: optional string to trim from each type name. Useful for trimming Hasura prepended schema name
8484
- withQueries: boolean flag for query TypeScript code generation
8585
- 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-
fragmentImportFrom: ./src/customFragments.ts
27+
typescriptCodegenOutputRelativePath: ../
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-
primaryCodegenTypeScriptImportPath: "../"
29+
typescriptCodegenOutputRelativePath: "../"
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-
primaryCodegenTypeScriptImportPath: "../"
41+
typescriptCodegenOutputRelativePath: "../"
4242
trimstring:
4343
withQueries: true
4444
withInserts: true
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
import gql from 'graphql-tag';
3-
import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
3+
import { VehicleGraphFieldsFragmentDoc } from '../';
44

55
// VehicleGraphFields GQL
66
//------------------------------------------------
@@ -10,20 +10,20 @@ import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
1010
// Query: FetchById
1111
//
1212

13-
const FETCH_VEHICLEGRAPHFIELDS_MODEL_BYID = gql`
13+
const FETCH_VEHICLEGRAPHFIELDS_BYID = gql`
1414
query fetchVehicleGraphFieldsById($vehicleId: String!) {
1515
vehicle_by_pk(id: $vehicleId) {
1616
...VehicleGraphFields
1717
}
1818
}
19-
${VehicleGraphFieldsModelFields}
19+
${VehicleGraphFieldsFragmentDoc}
2020
`;
2121

2222

2323
// Query: Fetch
2424
//
2525

26-
const FETCH_VEHICLEGRAPHFIELDS_MODELS = gql`
26+
const FETCH_VEHICLEGRAPHFIELDSS = gql`
2727
query fetchVehicleGraphFields(
2828
$distinct_on: [vehicle_select_column!]
2929
$where: vehicle_bool_exp
@@ -35,14 +35,14 @@ import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
3535
...VehicleGraphFields
3636
}
3737
}
38-
${VehicleGraphFieldsModelFields}
38+
${VehicleGraphFieldsFragmentDoc}
3939
`;
4040

4141

4242
// Mutation: Insert
4343
//
4444

45-
const INSERT_VEHICLEGRAPHFIELDS_MODEL = gql`
45+
const INSERT_VEHICLEGRAPHFIELDS = gql`
4646
mutation insertVehicleGraphFields($objects: [vehicle_insert_input!]!, $onConflict: vehicle_on_conflict) {
4747
insert_vehicle(objects: $objects, on_conflict: $onConflict) {
4848
affected_rows
@@ -51,14 +51,14 @@ import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
5151
}
5252
}
5353
}
54-
${VehicleGraphFieldsModelFields}
54+
${VehicleGraphFieldsFragmentDoc}
5555
`;
5656

5757

5858
// Mutation: Update by Id
5959
//
6060

61-
const UPDATE_VEHICLEGRAPHFIELDS_MODEL_BYID = gql`
61+
const UPDATE_VEHICLEGRAPHFIELDS_BYID = gql`
6262
mutation updateVehicleGraphFieldsById($id: String, $set: vehicle_set_input) {
6363
update_vehicle(_set: $set, where: { id: { _eq: $id } }) {
6464
affected_rows
@@ -67,14 +67,14 @@ import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
6767
}
6868
}
6969
}
70-
${VehicleGraphFieldsModelFields}
70+
${VehicleGraphFieldsFragmentDoc}
7171
`;
7272

7373

7474
// Mutation: Update
7575
//
7676

77-
const UPDATE_VEHICLEGRAPHFIELDS_MODELS = gql`
77+
const UPDATE_VEHICLEGRAPHFIELDSS = gql`
7878
mutation updateVehicleGraphFields($set: vehicle_set_input, $where:vehicle_bool_exp!) {
7979
update_vehicle(_set: $set, where: $where) {
8080
affected_rows
@@ -83,5 +83,5 @@ import { VehicleGraphFieldsFragmentDoc } from './src/customFragments.ts';
8383
}
8484
}
8585
}
86-
${VehicleGraphFieldsModelFields}
86+
${VehicleGraphFieldsFragmentDoc}
8787
`;

0 commit comments

Comments
 (0)