Skip to content

Commit

Permalink
Merge pull request #12340 from BLasan/fix-casting-issue
Browse files Browse the repository at this point in the history
Fix: Type Casting Issue on GraphQL invocation #12340
  • Loading branch information
BLasan committed Mar 22, 2024
2 parents 047ffd0 + 7d367cd commit 0cc31f8
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,18 @@ public static AuthenticationContext generateAuthenticationContext(String tokenSi
;
}
if (synCtx != null && APIConstants.GRAPHQL_API.equals(synCtx.getProperty(APIConstants.API_TYPE))) {
Integer graphQLMaxDepth = (int) (long) subscriptionTierObj.get(GraphQLConstants.GRAPHQL_MAX_DEPTH);
Integer graphQLMaxComplexity =
(int) (long) subscriptionTierObj.get(GraphQLConstants.GRAPHQL_MAX_COMPLEXITY);
Integer graphQLMaxDepth = 0;
if (subscriptionTierObj != null
&& subscriptionTierObj.get(GraphQLConstants.GRAPHQL_MAX_DEPTH) != null) {
graphQLMaxDepth = ((Number) subscriptionTierObj.get(
GraphQLConstants.GRAPHQL_MAX_DEPTH)).intValue();
}
Integer graphQLMaxComplexity = 0;
if (subscriptionTierObj != null
&& subscriptionTierObj.get(GraphQLConstants.GRAPHQL_MAX_COMPLEXITY) != null) {
graphQLMaxComplexity = ((Number) subscriptionTierObj.get(
GraphQLConstants.GRAPHQL_MAX_COMPLEXITY)).intValue();
}
synCtx.setProperty(GraphQLConstants.MAXIMUM_QUERY_DEPTH, graphQLMaxDepth);
synCtx.setProperty(GraphQLConstants.MAXIMUM_QUERY_COMPLEXITY, graphQLMaxComplexity);
}
Expand Down

0 comments on commit 0cc31f8

Please sign in to comment.