Skip to content

Commit

Permalink
Fixed .NET compatibility of ported features. (#7782)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Nov 29, 2024
1 parent cde43b5 commit 59379f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public DefaultAuthorizationHandler(
throw new ArgumentNullException(nameof(authorizationPolicyProvider));
_authorizationPolicyCache = authorizationPolicyCache ??
throw new ArgumentNullException(nameof(authorizationPolicyCache));

#if NET7_0_OR_GREATER
_canCachePolicies = _authorizationPolicyProvider.AllowsCachingPolicies;
#endif
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ namespace HotChocolate.Types;
[DirectiveType(WellKnownDirectives.SemanticNonNull, DirectiveLocation.FieldDefinition, IsRepeatable = false)]
public sealed class SemanticNonNullDirective(IReadOnlyList<int> levels)
{
#if NETSTANDARD2_0
[GraphQLType(typeof(ListType<NonNullType<IntType>>))]
#else
[GraphQLType<ListType<NonNullType<IntType>>>]
#endif
[DefaultValueSyntax("[0]")]
public IReadOnlyList<int>? Levels { get; } = levels;
}

0 comments on commit 59379f3

Please sign in to comment.