Currently the GraphQL top level object is instantiated via newGraphQL(x,y)
However PRs are already trying to add new capabilities wired into this top level object. And hence the constructor signature keeps expanding.
A Builder pattern should be used. eg:
GraphQL.newObject(StarWarsSchema.starWarsSchema)
.executionStrategy(new ExecutorServiceExecutionStrategy(threadPoolExecutor))
.build()
This would also be consistent with the way schema objects are built etc...which helps consumers avoid "cognitive dissonance" in the API
Currently the GraphQL top level object is instantiated via newGraphQL(x,y)
However PRs are already trying to add new capabilities wired into this top level object. And hence the constructor signature keeps expanding.
A Builder pattern should be used. eg:
This would also be consistent with the way schema objects are built etc...which helps consumers avoid "cognitive dissonance" in the API