use pattern matching (#1032)
use pattern matching (#1032)

minor perf improvement by avioding the duplication of type checks
graphql-dotnet/graphql-dotnet,graphql-dotnet/graphql-dotnet,graphql-dotnet/graphql-dotnet,joemcbride/graphql-dotnet,joemcbride/graphql-dotnet