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

The graphql:Context Init Method Should not have Input Parameters #6544

Closed
ThisaruGuruge opened this issue May 16, 2024 · 1 comment
Closed
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Type/Improvement
Milestone

Comments

@ThisaruGuruge
Copy link
Member

ThisaruGuruge commented May 16, 2024

Description:

The graphql:Context object currently has 3 input parameters; attributes, engine, and nextInterceptor. Except for the attributes parameter, others does not make sense.

  1. The attributes parameter: This can be used to initialize the context object with a set of attributes. This too is redundant as the set method can be used to set attributes. However, it can be useful in some scenarios.
  2. The engine parameter: This is not useful as the users cannot create a graphql:Engine object. So there's no point in passing this in the init method. Instead, it should be set internally, without exposing it to the public.
  3. The nextInterceptor parameter: This is not useful as well since the value should be 0 every time we create a context object. It should be incremented internally when an interceptor is executed.

Given the above reasons, I would suggest to remove the engine and nextInterceptor parameters from the init method of the graphql:Context object.

This will not break any existing code since the parameters are not used and we have not advised to use them anyway.

@ThisaruGuruge ThisaruGuruge added this to the 2201.10.0 milestone May 16, 2024
@ThisaruGuruge ThisaruGuruge added the module/graphql Issues related to Ballerina GraphQL module label Aug 6, 2024
@ThisaruGuruge ThisaruGuruge self-assigned this Aug 6, 2024
@ThisaruGuruge
Copy link
Member Author

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 Type/Improvement
Projects
Archived in project
Development

No branches or pull requests

1 participant