Skip to content

Commit

Permalink
Merge pull request #2150 from CrowleyRajapakse/new-main6
Browse files Browse the repository at this point in the history
Adding ratelimit extensionRef for graphql API resources wise
  • Loading branch information
CrowleyRajapakse authored Mar 21, 2024
2 parents cc4c77d + 675cfb5 commit aa7b369
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/config-deployer-service/ballerina/APIClient.bal
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,14 @@ public class APIClient {
(<model:GQLRouteFilter[]>filters).push(scopeFilter);
}
}
if operation.rateLimit != () {
model:RateLimitPolicy? rateLimitPolicyCR = self.generateRateLimitPolicyCR(apkConf, operation.rateLimit, apiArtifact.uniqueId, operation, organization);
if rateLimitPolicyCR != () {
apiArtifact.rateLimitPolicies[rateLimitPolicyCR.metadata.name] = rateLimitPolicyCR;
model:GQLRouteFilter rateLimitPolicyFilter = {extensionRef: {group: "dp.wso2.com", kind: "RateLimitPolicy", name: rateLimitPolicyCR.metadata.name}};
(<model:GQLRouteFilter[]>filters).push(rateLimitPolicyFilter);
}
}
if operation.operationPolicies != () {
model:APIPolicy? apiPolicyCR = check self.generateAPIPolicyAndBackendCR(apiArtifact, apkConf, operation, operation.operationPolicies, organization, apiArtifact.uniqueId);
if apiPolicyCR != () {
Expand Down

0 comments on commit aa7b369

Please sign in to comment.