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
<p>Please note that the <codeclass="language-text">SchemaExporter</code> class will export type defintions as type extensions
292
292
(e.g. <codeclass="language-text">extend type MyType { ... }</code>) only when it was read as such by the <codeclass="language-text">SchemaBuilder</code>.</p>
293
293
<p>Please see the <codeclass="language-text">SchemaExtensions.PrintAsync</code> source code implementation specifics.</p>
<p>Since 7.9 you can enable the inference of the field nullability from the Null Reference Types (NRT)
296
+
annotations when defining the field with expression. To enable the feature set the<br>
297
+
<codeclass="language-text">GlobalSwitches.InferFieldNullabilityFromNRTAnnotations</code> to <codeclass="language-text">true</code>.</p>
298
+
<p>For example, given the following code</p>
299
+
<divclass="gatsby-highlight" data-language="c#"><preclass="language-c#"><codeclass="language-c#">public class Person
300
+
{
301
+
public string FullName { get; set; }
302
+
public string? SpouseName { get; set; }
303
+
public IList<string>? Children { get; set; }
304
+
}
305
+
306
+
public class PersonGraphType : ObjectGraphType<Person>
307
+
{
308
+
public PersonGraphType()
309
+
{
310
+
Field(p => p.FullName);
311
+
Field(p => p.SpouseName);
312
+
Field(p => p.Children);
313
+
}
314
+
}</code></pre></div>
315
+
<p>When <codeclass="language-text">InferFieldNullabilityFromNRTAnnotations</code> is <codeclass="language-text">false</code> (default), the result is:</p>
0 commit comments