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

Provide DataLoader registry #66

Open
bkuberek opened this issue Oct 4, 2019 · 1 comment
Open

Provide DataLoader registry #66

bkuberek opened this issue Oct 4, 2019 · 1 comment

Comments

@bkuberek
Copy link
Member

bkuberek commented Oct 4, 2019

Currently, the GraphqlPostHandler constructs an ExecutionInput and executes the graphql query without providing an option for user provided DataLoaderRegistry

ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(query).operationName(operationName).context(exchange).root(exchange).variables(variables).build();

When using DataLoader we need to set dataLoaderRegistry

ExecutionInput executionInput = newExecutionInput()
    .query(query)
    .operationName(operationName)
    .context(exchange)
    .root(exchange)
    .variables(variables)
    .dataLoaderRegistry(registry) // <---
    .build()

Alternatively, we should be able to use Instrumentation.instrumentExecutionInput(input, parameters), but there is a bug in graphql graphql-java/graphql-java#1667

It is still possible to do it via instrumentation but I think data loader registry could be added to router.

@stevehu
Copy link
Contributor

stevehu commented Oct 4, 2019

I totally agree. This is a new feature added to the graphql-java lately. Would you be able to submit a PR for this? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants