Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized Resolver Context Initialization
- Loading branch information
1 parent
baaabd7
commit 159d34d
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 11 additions & 16 deletions
27
src/HotChocolate/Core/src/Execution/Processing/OperationContext.Services.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
using System; | ||
using HotChocolate.Types; | ||
|
||
namespace HotChocolate.Execution.Processing; | ||
|
||
// note: we are not asserting the properties here for performance reasons. | ||
// These properties are used by the middleware context which means that potentially | ||
// all fields will access them. | ||
internal sealed partial class OperationContext | ||
{ | ||
/// <summary> | ||
/// Gets the request scoped services | ||
/// </summary> | ||
public IServiceProvider Services | ||
{ | ||
get | ||
{ | ||
AssertInitialized(); | ||
return _services; | ||
} | ||
} | ||
public IServiceProvider Services => _services; | ||
|
||
/// <summary> | ||
/// Gets the activator helper class. | ||
/// </summary> | ||
public IActivator Activator | ||
{ | ||
get | ||
{ | ||
AssertInitialized(); | ||
return _activator; | ||
} | ||
} | ||
public IActivator Activator => _activator; | ||
|
||
/// <summary> | ||
/// Gets access to the input parser. | ||
/// </summary> | ||
public InputParser InputParser => _inputParser; | ||
} |