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: website/src/pages/docs/commands/diff.mdx
+21-11Lines changed: 21 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -201,43 +201,53 @@ get passed to `http://your-schema-2/graphql`.
201
201
202
202
<Callout>Note: `--left-header` and `--right-header` overrides the `--header` flags.</Callout>
203
203
204
-
205
204
## Support for Custom Directives
206
205
207
-
GraphQL Inspector offers enhanced support for custom directives, allowing users to easily detect changes in directive usage within GraphQL schemas. This feature greatly improves the capabilities of schema diffing, enabling comprehensive tracking of modifications related to custom directives across different schema versions.
206
+
GraphQL Inspector offers enhanced support for custom directives, allowing users to easily detect
207
+
changes in directive usage within GraphQL schemas. This feature greatly improves the capabilities of
208
+
schema diffing, enabling comprehensive tracking of modifications related to custom directives across
209
+
different schema versions.
208
210
209
211
### How to Use
210
212
211
-
1.**Define Custom Directives:** Begin by defining custom directives within your GraphQL schemas. Specify their usage on various schema elements such as types, fields, arguments, and more.
213
+
1.**Define Custom Directives:** Begin by defining custom directives within your GraphQL schemas.
214
+
Specify their usage on various schema elements such as types, fields, arguments, and more.
215
+
212
216
```graphql
213
217
directive@customDirectiveonFIELD_DEFINITION
214
218
```
215
219
216
-
2. **RunSchemaDiff:** UtilizethediffcommandprovidedbyGraphQLInspector. SpecifythepathsorURLstotheoldandnewschema files. Make sure that both schemas include the custom directives you want to track.
URLstotheoldandnewschema files. Make sure that both schemas include the custom directives
222
+
you want to track.
223
+
217
224
```bash
218
225
graphql-inspector diff OLD_SCHEMA NEW_SCHEMA
219
226
```
220
227
221
-
Replace `OLD_SCHEMA` and `NEW_SCHEMA` with the paths or URLs pointing to your old and new schemas respectively.
228
+
Replace `OLD_SCHEMA` and `NEW_SCHEMA` with the paths or URLs pointing to your old and new schemas
229
+
respectively.
222
230
223
-
3. **Review Changes:** After executing the diff command, GraphQL Inspector will analyze the schemas and identify any modifications related to custom directive usage. The output will provide detailed information about the detected changes, categorized based on their impact.
231
+
3. **Review Changes:** After executing the diff command, GraphQL Inspector will analyze the schemas
232
+
and identify any modifications related to custom directive usage. The output will provide
233
+
detailed information about the detected changes, categorized based on their impact.
224
234
225
235

226
236
227
237
### Example
228
238
229
239
```graphql filename="OLD_SCHEMA"
230
240
input Foo {
231
-
a: String
232
-
b: String
241
+
a: String
242
+
b: String
233
243
}
234
244
```
235
245
236
246
```graphql filename="NEW_SCHEMA"
237
247
directive@fooonINPUT_FIELD_DEFINITION
238
248
inputFoo {
239
-
a: String@foo
240
-
b: String
249
+
a: String@foo
250
+
b: String
241
251
}
242
252
```
243
253
@@ -255,4 +265,4 @@ GraphQL Inspector's support for custom directives covers various schema elements
0 commit comments