Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce GraphQL Interceptor Configs #4254

Closed
DimuthuMadushan opened this issue Mar 23, 2023 · 0 comments
Closed

Introduce GraphQL Interceptor Configs #4254

DimuthuMadushan opened this issue Mar 23, 2023 · 0 comments
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Team/PCM Protocol connector packages related issues Type/Improvement

Comments

@DimuthuMadushan
Copy link

Description:
Part of #4199

To improve the GraphQL interceptor execution, it needs to introduce a new annotation for GraphQL interceptors. This annotation can be defined as follows:

public type InterceptorConfig record {|
    boolean global = true
|}

It can be used with GraphQL interceptor as follows:

@graphql:InterceptorConfig {
    global: true
}
readonly service class ServiceInterceptor {
    isolated remote function execute() returns anydata|error{
        //...
    }
}

The behavior of the global flag:

  • if true: The interceptor will be applied to each and every field and subfield.
  • if false: The interceptor will be applied to that particular type

Note: The flag applies only to the Service Interceptors

More details can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/graphql Issues related to Ballerina GraphQL module Team/PCM Protocol connector packages related issues Type/Improvement
Projects
Archived in project
Development

No branches or pull requests

1 participant