Skip to content

A generalised configuration mechanism #3945

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

bbakerman
Copy link
Member

@bbakerman bbakerman commented May 1, 2025

Discoverability of how to config special parts of graphql-java is low

This tries to centralise that by providing a simple DSL and a common place to set both JVM wide and execution specific configuration

This is currently

        def builder = GraphQLContext.newContext()
        GraphQL.configuration().incrementalSupport().enableIncrementalSupport(builder, true)

but it could be

        def builder = GraphQLContext.newContext()
        GraphQL.configuration.incrementalSupport.enableIncrementalSupport(builder, true)

or

GraphQLConfiguration.IncrementalSupport.enableIncrementalSupport(builder, true)

but I kinda like how it comes off the GraphQl object for discoverability

@bbakerman bbakerman requested a review from andimarek May 1, 2025 08:47
* including some JVM wide settings and some per execution settings
* as well as experimental ones
*/
public class GraphQLConfiguration {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other name suggestion GraphQlSettings and hence the name of GraphQl.configuration() would change

@@ -175,7 +175,7 @@ public static ParserOptions getDefaultSdlParserOptions() {
*
* This static can be set to true to allow the behavior of version 16.x or before.
*
* @param options - the new default JVM parser options for operation parsing
* @param options - the new default JVM parser options for SDL parsing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found a java doc mistake

Copy link
Contributor

github-actions bot commented May 1, 2025

Test Results

  313 files    313 suites   53s ⏱️
3 585 tests 3 580 ✅ 5 💤 0 ❌
3 674 runs  3 669 ✅ 5 💤 0 ❌

Results for commit 2f9728e.

♻️ This comment has been updated with latest results.

return INCREMENTAL_SUPPORT_CFG;
}

public static class ParserCfg {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse config here is repeated - so sure you can go direct to ParserOptions and thats not too bad a name to discover

BUT

This makes it central and future ones can be here

…ntext wrapping mechanism - renamed as config
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

Successfully merging this pull request may close these issues.

1 participant