◐ Shell
reader mode source ↗
Skip to content

Caching parse and validate by default#4121

Open
bbakerman wants to merge 8 commits into
masterfrom
caching-query-parsing-and-validation
Open

Caching parse and validate by default#4121
bbakerman wants to merge 8 commits into
masterfrom
caching-query-parsing-and-validation

Conversation

@bbakerman

Copy link
Copy Markdown
Member

This is some early work to cache parsed and validated documents by default.

This is discussed in more detailed here #4107

@bbakerman bbakerman added this to the 25.x breaking changes milestone Sep 19, 2025
@github-actions

github-actions Bot commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

Test Results

  326 files    326 suites   3m 31s ⏱️
5 026 tests 5 020 ✅ 6 💤 0 ❌
5 115 runs  5 109 ✅ 6 💤 0 ❌

Results for commit c42baa7.

♻️ This comment has been updated with latest results.

@bbakerman

Copy link
Copy Markdown
Member Author

I have manually tested a consumer where Caffiene is and is not on the classpath

TypeDefinitionRegistry registry = new SchemaParser().parse("type Query { f : String }");
        RuntimeWiring runtimeWiring = RuntimeWiring.MOCKED_WIRING;
        GraphQLSchema graphQLSchema = new SchemaGenerator().makeExecutableSchema(registry, runtimeWiring);

        GraphQL graphQL = GraphQL.newGraphQL(graphQLSchema).build();

        for (int i = 1; i <= 5; i++) {
            //TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
            // for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
            ExecutionInput ei = ExecutionInput.newExecutionInput().query("query q { f }").root(Map.of("f", "F")).build();
            ExecutionResult er = graphQL.execute(ei);
            System.out.println("i" + i + "data :  " + er.getData() + " : errors : " + er.getErrors());
        }
dependencies {
    implementation("com.graphql-java:graphql-java:0.0.0-caching-query-parsing-and-validation-SNAPSHOT")
    implementation("com.github.ben-manes.caffeine:caffeine:3.1.8")
}

or

dependencies {
    implementation("com.graphql-java:graphql-java:0.0.0-caching-query-parsing-and-validation-SNAPSHOT")
}

I can confirm the Caffeine detection code works as expected and it does NOT load any Caffeine code unless its present and hence it works as a No Op when caffeine is NOT present but caches when it is present

@dondonz dondonz modified the milestones: 25.x breaking changes, 26.x Oct 29, 2025
@dondonz dondonz added the keep-open Tells Stale Bot to keep PRs and issues open label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

keep-open Tells Stale Bot to keep PRs and issues open

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants