RestFQL for spring is a rest middleware that implements the specification.
In short RestFQL allows filtering of response driven by the querying side without breaking caching and keeping the capability for the backend to do optimizations as required.
- Add repository if not use the version on maven central
repositories {
...
maven {
url = uri("https://maven.pkg.github.com/restfql/spring-restfql")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
- install with a package manager
val restfql_version = "1.0.8"
dependencies {
implementation("com.restfql:spring-restfql:$restfql_version")
}
- Add a configuration with the import to the
RestFQLConfiguration.class
@Configuration
@Import(RestFQLConfiguration.class)
public class AppConfig {}
- query passing the model as a query param call
fql