TypeLoader: implement Try methods (#1358)

* TypeLoader: implement Try methods

* fix
This commit is contained in:
Stef Heyenrath
2025-08-31 08:48:29 +02:00
committed by GitHub
parent 5c5e104f2c
commit 371bfdc160
10 changed files with 190 additions and 81 deletions

View File

@@ -100,7 +100,10 @@ public class RequestMessageGraphQLMatcher : IRequestMatcher
IDictionary<string, Type>? customScalars
)
{
var graphQLMatcher = TypeLoader.LoadNewInstance<IGraphQLMatcher>(schema, customScalars, matchBehaviour, MatchOperator.Or);
return [graphQLMatcher];
if (TypeLoader.TryLoadNewInstance<IGraphQLMatcher>(out var graphQLMatcher, schema, customScalars, matchBehaviour, MatchOperator.Or))
{
return [graphQLMatcher];
}
return [];
}
}