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

Ability to supply a different GraphQL java based upon the request context. #2680

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from

Conversation

NavidMitchell
Copy link

@NavidMitchell NavidMitchell commented Nov 13, 2024

Motivation:

I need to use a different GraphQL java object to process each request. This is because I currently am providing a different GraphQL schema based on a path parameter that is configured for my handler.

Ex:

        GraphQLProvider graphQlProvider = new GraphQlProvider();
        router.post(properties.getGraphqlPath()+":"+NAMESPACE_PATH_PARAMETER)
              .consumes("application/json")
              .consumes("application/graphql")
              .produces("application/json")
              .handler(BodyHandler.create(false)
                                  .setBodyLimit(properties.getMaxHttpBodySize()))
              .handler(new GqlHandler(graphQlProvider));

The design I used in the commits is probably not the cleanest. Maybe the GraphQL Provider Function should be added with a fluent method like the queryContext ext. I am not sure what makes the most sense, since the GraphQL object is currently a constructor parameter. I can change the code to whatever the Vertx team wants. But I wanted to make sure there was interest in supporting this before spending too much time.

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

Successfully merging this pull request may close these issues.

1 participant