The Wayback Machine - https://web.archive.org/web/20210831221552/https://github.com/Netflix/dgs-framework/releases
Skip to content

@paulbakker paulbakker released this Aug 31, 2021

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

Assets 2
Pre-release

@paulbakker paulbakker released this Aug 31, 2021

Support for proding a bean of type PreparsedDocumentProvider
Assets 2

@github-actions github-actions released this Aug 26, 2021

🔴 ALERT
We recommend developers to wait for 4.7.0, when available, since it has important fixes for Input Arguments serialization.
The serialization of an input argument into a collection requires an explicit collection type fails in this version.

What’s Changed

  • Custom implementation of convertValue for input types (#549) @paulbakker.
  • DataFetchers can have an input argument annotated with@CookieValue to express that such value should be fetch from the cookie inside the web request. (#542) @paulbakker.
  • In your server you can now declare a GraphQL Directive via the @DgsDirective annotation. (#536) @hantsy
  • Metrics should skip instrumenting data fetchers annotated with @DgsEnableDataFetcherInstrumentation(false) (#577) @berngp
  • Support methods that have multiple @DgsData annotations. (#574) @berngp
  • Add the @connection directive automatically when pagination module is used. (#568) @srinivasankavitha

⚠️ WARNING
Due the changes on #549 there are implicit modification on how GraphQL ID are serialized to input arguments.
The serialization of a GraphQL ID input argument to a Java java.util.Long will not happen out of the box now.
In principal this is not correct since an ID should be treated as a String, GraphQL defines it as follows... "the ID scalar type represents a unique identifier, often used to refetch an object or as the key for a cache. The ID type is serialized in the same way as a String; however, defining it as an ID signifies that it is not intended to be human‐readable." ref.

Performance Improvements

  • Avoid calculating the stacktrace when calling ExecutionStrategyInstrumentationContext (#562 & #567) @berngp
  • Call the ListableBeanFactory only once when fetching the MeterRegistry (#551) @berngp

Other

  • chore: Add @JsonCreator to TypedGraphQLError (#556) @hantsy
  • Added a test for working with a custom scalar for an input variable in the client (#572) @paulbakker
  • Added test for input arguments without annotation. (#564) @paulbakker
  • Bump spectator-api from 0.133.+ to 0.134.0 (#563) @dependabot
Assets 2
Pre-release
Pre-release

@github-actions github-actions released this Aug 23, 2021

What’s Changed

  • Avoid unnecessarily calculating the stacktrace when calling ExecutionStrategyInstrumentationContext (#562) @berngp
Assets 2
Pre-release

@paulbakker paulbakker released this Aug 23, 2021

Account for enums in input arguments
Assets 2
Pre-release
Pre-release

@github-actions github-actions released this Aug 20, 2021

What’s Changed

  • Call the ListableBeanFactory only once when fetching the MeterRegistry (#551) @berngp
Assets 2
Pre-release

@paulbakker paulbakker released this Aug 20, 2021

Upgrade to Gradle 7.2 and Nebula 10.1.0
Assets 2
Pre-release

@paulbakker paulbakker released this Aug 20, 2021

Upgrade to Gradle 7.2 and Nebula 10.1.0
Assets 2

@srinivasankavitha srinivasankavitha released this Aug 12, 2021

What’s Changed

  • Address incorrect operation tag value (#519) @berngp
  • Avoid instantiating Jackson mappers per request (#501) @kilink
  • Avoid chaining collection operations (#500) @kilink
  • Replace ci.yml with ci-compatibility.yml (#511) @berngp
  • Assert Date, Time, and DateTime Scalar serde. (#506) @berngp
  • Fix assertSubscription helper method (#499) @kilink
Assets 2
Pre-release
Pre-release

@github-actions github-actions released this Aug 7, 2021

What’s Changed

  • Address incorrect operation tag value (#519) @berngp
  • Avoid instantiating Jackson mappers per request (#501) @kilink
  • Avoid chaining collection operations (#500) @kilink
  • Replace ci.yml with ci-compatibility.yml (#511) @berngp
  • Assert Date, Time, and DateTime Scalar serde. (#506) @berngp
  • Fix assertSubscription helper method (#499) @kilink
Assets 2