diff --git a/spring-graphql-docs/src/docs/asciidoc/index.adoc b/spring-graphql-docs/src/docs/asciidoc/index.adoc index fce3bdff..83f9ccf1 100644 --- a/spring-graphql-docs/src/docs/asciidoc/index.adoc +++ b/spring-graphql-docs/src/docs/asciidoc/index.adoc @@ -300,12 +300,15 @@ default it is marked as `INTERNAL_ERROR`. Spring GraphQL supports use of http://www.querydsl.com/[Querydsl] to fetch data through the Spring Data https://docs.spring.io/spring-data/commons/docs/current/reference/html/#core.extensions[Querydsl extension]. +Querydsl provides a flexible yet typesafe approach to express query predicates by +generating a meta-model using annotation processors. For example, declare a repository as `QuerydslPredicateExecutor`: [source,java,indent=0,subs="verbatim,quotes"] ---- -public interface AccountRepository extends QuerydslPredicateExecutor { +public interface AccountRepository extends Repository, + QuerydslPredicateExecutor { } ---- @@ -330,6 +333,14 @@ If the repository is `ReactiveQuerydslPredicateExecutor`, the builder returns `DataFetcher>` or `DataFetcher>`. Spring Data supports this variant for MongoDB. +The Querydsl integration allows customizing the request parameters binding onto a +`Predicate` by accepting a `QuerydslBinderCustomizer`. Request parameters are bound +by default as "is equal to" for each available property in the request. + +`QuerydslDataFetcher` supports +https://docs.spring.io/spring-data/commons/docs/current/reference/html/#projections[interface and DTO projections] +to transform query results before returning these for further GraphQL processing. + The {repository}/samples/webmvc-http[webmvc-http] sample in the Spring GraphQL repository uses Querydsl to fetch `artifactRepositories`.