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
from user code, similar to <codeclass="language-text">HttpContextAccessor</code> or <codeclass="language-text">DataLoaderContextAccessor</code>. This is useful when
1293
1293
you need to access the current field resolution context from services or other code that doesn't have
1294
1294
direct access to the context parameter.</p>
1295
+
<p>Additionally, the <codeclass="language-text">IRequiresResolveFieldContextAccessor</code> interface has been added to allow resolvers
1296
+
to indicate whether they require the context accessor. Resolvers that implement this interface and
1297
+
return <codeclass="language-text">false</code> for the <codeclass="language-text">RequiresResolveFieldContextAccessor</code> property will not have the context accessor
1298
+
middleware applied, even when <codeclass="language-text">AddResolveFieldContextAccessor()</code> is called globally. This provides an
1299
+
optimization to avoid the overhead of the context accessor for resolvers that don't need it, such as
1300
+
simple property accessors.</p>
1295
1301
<p>To enable the context accessor, call <codeclass="language-text">AddResolveFieldContextAccessor()</code> on your GraphQL builder:</p>
1296
1302
<divclass="gatsby-highlight" data-language="csharp"><preclass="language-csharp"><codeclass="language-csharp">services<spanclass="token punctuation">.</span><spanclass="token function">AddGraphQL</span><spanclass="token punctuation">(</span>b <spanclass="token operator">=></span> b
0 commit comments