github Netflix/dgs-framework v4.7.0
4.7.0

latest releases: v9.1.3, v9.1.2, v9.1.1...
3 years ago

New Features

Support for providing a bean of type PreparsedDocumentProvider (#583) @paulbakker

It is now possible to register a bean of type PreparsedDocumentProvider, which the framework uses during query execution.
A PreparsedDocumentProvider can be used to build a cache of queries that were previously parsed, which can improve query execution performance.

The developer is responsible for choosing and configuring a cache implementation. The following is an example using Caffeine.

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Configuration
	static class PreparsedDocumentProviderConfig {

		private final Cache<String, PreparsedDocumentEntry> cache = Caffeine.newBuilder().maximumSize(250)
				.expireAfterAccess(5, TimeUnit.MINUTES).recordStats().build();


		@Bean
		public PreparsedDocumentProvider preparsedDocumentProvider() {
			return (executionInput, parseAndValidateFunction) -> {
				Function<String, PreparsedDocumentEntry> mapCompute = key -> parseAndValidateFunction.apply(executionInput);
				return cache.get(executionInput.getQuery(), mapCompute);
			};
		}
	}
}

Bug fixes

Fix lists nested in input types for input arguments (#591) @paulbakker

This fixes a bug that was introduced in 4.6.0 that caused lists of input objects nested inside an input object to not be deserialized correctly for @InputArgument values.

Other changes

Don't miss a new dgs-framework release

NewReleases is sending notifications on new releases.