Skip to content

Commit dd794d2

Browse files
SimonCroppjoemcbride
authored andcommitted
remove duplicate dict hash lookup (graphql-dotnet#1118)
1 parent 3cf9c12 commit dd794d2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/GraphQL/Types/ResolveFieldContext.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,12 @@ public TType GetArgument<TType>(string name, TType defaultValue = default)
8585
public object GetArgument(System.Type argumentType, string name, object defaultValue = null)
8686
{
8787
var argumentName = Schema?.FieldNameConverter.NameFor(name, null) ?? name;
88-
89-
if (!HasArgument(argumentName))
88+
89+
if (Arguments == null || !Arguments.TryGetValue(argumentName, out var arg))
9090
{
9191
return defaultValue;
9292
}
9393

94-
var arg = Arguments[argumentName];
9594
if (arg is Dictionary<string, object> inputObject)
9695
{
9796
var type = argumentType;

0 commit comments

Comments
 (0)