File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -187,3 +187,20 @@ import { schema as sourceSchema } from "./my-schema";
187
187
188
188
export const schema = semanticToStrict(sourceSchema);
189
189
```
190
+
191
+ ## Advanced usage
192
+
193
+ If you just want to convert a single ` GraphQLFieldConfig ` you can use the
194
+ ` convertFieldConfig ` method, passing the field config and ` true ` to convert
195
+ semantic non-null positions to strict non-nulls, or ` false ` if you want to
196
+ convert to nullable:
197
+
198
+ ``` ts
199
+ const strictFieldConfig = convertFieldConfig (fieldConfig , true );
200
+ const nullableFieldConfig = convertFieldConfig (fieldConfig , false );
201
+ ```
202
+
203
+ > [ !NOTE]
204
+ >
205
+ > This method assumes that the fieldConfig has come from parsing an SDL string,
206
+ > and thus has an ` astNode ` that includes a ` @semanticNonNull ` directive.
You can’t perform that action at this time.
0 commit comments