You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-37Lines changed: 37 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,24 +23,24 @@ npm install -D ts-gql-plugin
23
23
24
24
Then add plugin to your `tsconfig.json`
25
25
26
-
```json5
26
+
```jsonc
27
27
{
28
-
compilerOptions: {
29
-
plugins: [
28
+
"compilerOptions": {
29
+
"plugins": [
30
30
{
31
-
name:'ts-gql-plugin',
32
-
},
33
-
],
34
-
},
31
+
"name":"ts-gql-plugin"
32
+
}
33
+
]
34
+
}
35
35
}
36
36
```
37
37
38
38
Since this plugin use [graphql-config](https://www.graphql-config.com/docs/user/user-introduction) you should add a config file targeting your GraphQL schema.
39
39
40
-
```json5
40
+
```jsonc
41
41
// .graphqlrc
42
42
{
43
-
schema:'./schema.graphql',
43
+
"schema":"./schema.graphql"
44
44
}
45
45
```
46
46
@@ -97,20 +97,20 @@ Configuration can be done at 2 levels: in tsconfig.json and in graphql-config fi
97
97
98
98
You can add project-related configuration using extension `"ts-gql"`.
99
99
100
-
```json5
100
+
```jsonc
101
101
// .graphqlrc
102
102
{
103
-
schema:'./schema.graphql',
104
-
extensions: {
105
-
'ts-gql': {
106
-
codegenConfig: {
107
-
defaultScalarType:'unknown',
108
-
scalars: {
109
-
DateTime:'String',
110
-
},
111
-
},
112
-
},
113
-
},
103
+
"schema":"./schema.graphql",
104
+
"extensions": {
105
+
"ts-gql": {
106
+
"codegenConfig": {
107
+
"defaultScalarType":"unknown",
108
+
"scalars": {
109
+
"DateTime":"String"
110
+
}
111
+
}
112
+
}
113
+
}
114
114
}
115
115
```
116
116
@@ -124,17 +124,17 @@ You can add project-related configuration using extension `"ts-gql"`.
124
124
125
125
If you should handle multiple GraphQL projects (= multiple schemas), define projects into your graphql-config file.
126
126
127
-
```json5
127
+
```jsonc
128
128
// .graphqlrc
129
129
{
130
-
projects: {
131
-
Catalog: {
132
-
schema:'./catalog/schema.graphql',
130
+
"projects": {
131
+
"Catalog": {
132
+
"schema":"./catalog/schema.graphql"
133
133
},
134
-
Channel: {
135
-
schema:'./channel/schema.graphql',
136
-
},
137
-
},
134
+
"Channel": {
135
+
"schema":"./channel/schema.graphql"
136
+
}
137
+
}
138
138
}
139
139
```
140
140
@@ -143,16 +143,16 @@ If you should handle multiple GraphQL projects (= multiple schemas), define proj
143
143
Then into your plugin config define project name regex, following your own constraints.
144
144
This regex is used to extract project name from operations.
0 commit comments