The `graphql:Context` Init Method Should not have Input Parameters
Opened this issue · 0 comments
ThisaruGuruge commented
Description:
The graphql:Context
object currently has 3 input parameters; attributes
, engine
, and nextInterceptor
. Except for the attributes
parameter, others does not make sense.
- The
attributes
parameter: This can be used to initialize the context object with a set of attributes. This too is redundant as theset
method can be used to set attributes. However, it can be useful in some scenarios. - The
engine
parameter: This is not useful as the users cannot create agraphql:Engine
object. So there's no point in passing this in theinit
method. Instead, it should be set internally, without exposing it to the public. - The
nextInterceptor
parameter: This is not useful as well since the value should be0
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.