dgs-framework

GraphQL for Java with Spring Boot made easy.

APACHE-2.0 License

Stars
3.1K

Bot releases are hidden (Show)

dgs-framework - v4.7.2

Published by berngp about 3 years ago

What’s Changed

  • Convert fix (#595) @paulbakker
dgs-framework - 4.7.0

Published by paulbakker about 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

  • Added test with null value for scalar in input argument (#590) @paulbakker
  • Added test using Object scalar (#589) @paulbakker
  • Upgrade to nebula netflixoss 10.2.0 (#581) @berngp
dgs-framework -

Published by paulbakker about 3 years ago

dgs-framework -

Published by paulbakker about 3 years ago

dgs-framework -

Published by paulbakker about 3 years ago

dgs-framework -

Published by paulbakker about 3 years ago

dgs-framework - v4.5.1

Published by srinivasankavitha about 3 years ago

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
dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework - v3.12.0

Published by srinivasankavitha over 3 years ago

What's Changed

  • DgsQueryExecutor.executeAndExtractJsonPath overloading for httpHeaders #302 @sbilello
  • Implement calculation of query complexity metric. #300 @srinivasankavitha
  • Adding the graphql-dgs-spring-boot-micrometer to the example #297 @berngp
  • Rename packages from autoconfig -> autoconfigure #279 @bono007
  • Removing dependencies to rxjava in favor of reactor. #295 @berngp
  • Switch to -Xjvm-default=enable compiler flag #287 @kilink
  • Added comments about controller classes being "open" #278 @paulbakker
  • Add open keyword to class definition of @RestController classes #275 @lucatk
  • Added docs to DgsQueryExecutor #276 @paulbakker
  • Updated GraphQL Java Extended Scalars version in platform BOM #273 @marceloverdijk
dgs-framework - v3.12.0-rc.2

Published by srinivasankavitha over 3 years ago

Candidate release to test query complexity metric.

dgs-framework - v3.12.0-rc.1

Published by srinivasankavitha over 3 years ago

Creating a candidate release to test metrics.

dgs-framework - 3.11.0

Published by paulbakker over 3 years ago

What’s Changed

Highlights

Support for Optional input arguments

Input arguments are often defined as optional in schemas.
Your datafetcher code needs to null-check arguments to check if they were provided.
Instead of null-checks you can wrap an input argument in an Optional.

public List<Show> shows(@InputArgument(collectionType = ShowFilter.class) Optional<ShowFilter> filter)

You do need to provide the type in the collectionType argument when using complex types, similar to using lists.
If the argument is not provided, the value will be Optional.empty().
It's a matter of preference to use Optional or not.

Auto-Configuration that registers graphql-java-extended-scalars' Scalars

If you use scalars from the graphql-java-extended-scalars library, such as Long, we now have a convenient way to register the scalars to your DGS. Simply add the graphql-dgs-extended-scalars module to your Gradle/Maven build and the scalars will be automatically registered.
More information about further configuration knobs can be found in the docs.

Configure the location of the GraphQL Schema Files

You can now configure the location of your GraphQL schema files via the dgs.graphql.schema-locations property.
By default it will attempt to load them from the schema directory via the Classpath, i.e. using classpath*:schema/**/*.graphql*.
Let's go through an example, let's say you want to change the directory from being schema to graphql-schemas,
you would define your configuration as follows:

dgs:
    graphql:
        schema-locations:
            - classpath*:graphql-schemas/**/*.graphql*

Now, if you want to add additional locations to look for the GraphQL Schema files you an add them to the list.
For example, let's say we want to also look into your graphql-experimental-schemas:

dgs:
    graphql:
        schema-locations:
            - classpath*:graphql-schemas/**/*.graphql*
            - classpath*:graphql-experimental-schemas/**/*.graphql*

Complete list of merged pull requests

  • Bugfix: Allow JSON Documents with DateTime scalars to be deserialized to Objects (#271) @richardcresswell
  • Use Micrometer APIs compatible with both Micrometer 1.5 and 1.6 (#268) @berngp
  • Support Optional for @InputArgument (#267) @paulbakker
  • Fix for #250, defaultValue and required arguments (#264) @paulbakker
  • Update versions for Spring, Spring Security, Spring Cloud, Kotlin, and Jackson (#263) @berngp
  • Upgrading to Spring Boot to 2.3.9.RELEASE (#261) @berngp
  • Exceptions thrown by DgsEntityFetcher should be handled (#253) @srinivasankavitha
  • Revert "Update Gradle Wrapper from 6.8.3 to 7.0" (#254) @berngp
  • Update Gradle Wrapper from 6.8.3 to 7.0 (#252) @github-actions
  • Use DgsQueryExecutor instead of MockMVC (#244) @berngp
  • Auto-Configuration that registers graphql-java-extended-scalars' Scalars (#242) @berngp
  • Define a recommendation for graphql-java-extended-scalars (#232) @berngp
  • Fix for #200. Annotations should respect @AliasFor (#227) @paulbakker
  • The Platform is exposed as API to address composite builds (#225) @berngp
  • Introduced dgs.graphql.schema-locations configuration property (#210) @marceloverdijk
  • Allow specifying the operation name and query names (#195) @lucastorri
dgs-framework - v3.10.1

Published by berngp over 3 years ago

dgs-framework -

Published by paulbakker over 3 years ago

dgs-framework - v3.9.1

Published by srinivasankavitha over 3 years ago

  • added a test for using a List type with GraphQLResponse (#164) @paulbakker
  • Feature for setting the response headers in the GraphQLResponse in GraphQLClient (#161) @srinivasankavitha
  • Fix for performance issue caused by not re-using instances of ParameterDiscoverer (#160) @paulbakker
  • Contributing guide (#157) @paulbakker