-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination Support with Querydsl and Query By Example #597
Comments
rstoyanchev
added a commit
that referenced
this issue
Apr 12, 2023
rstoyanchev
added a commit
that referenced
this issue
Apr 12, 2023
This makes it possible to customize these settings individually, optionally, and via QuerydslBuilderCustomizer. See gh-597
rstoyanchev
added a commit
that referenced
this issue
Apr 13, 2023
rstoyanchev
added a commit
that referenced
this issue
Apr 13, 2023
rstoyanchev
added a commit
that referenced
this issue
Apr 13, 2023
@rstoyanchev Hi! This framework is great. I'm having trouble setting up sorting via the QueryDSL support here. Can you provide an example of how this is supposed to work? I followed the documentation here but was unsuccessful. Here is my example: Repository @GraphQlRepository
public interface CustWebTranRepository extends PagingAndSortingRepository<CustWebTran,CustWebTranPK>,
QuerydslPredicateExecutor<CustWebTran> {
} Schema type Query {
transaction(customerId: String
...
first:Int
after:String
last:Int
before:String,
sort: [String],
direction: Direction
): CustWebTranConnection
}
type CustWebTranConnection {
edges: [CustWebTranEdge]!
pageInfo: PageInfo!
}
type CustWebTranEdge {
node: CustWebTran!
cursor: String!
} SortStrategy Bean @Bean
public SortStrategy sortStrategy() {
return new AbstractSortStrategy() {
@Override
protected List<String> getProperties(DataFetchingEnvironment environment) {
return environment.getArgument("sort");
}
@Override
protected Sort.Direction getDirection(DataFetchingEnvironment environment) {
return Sort.Direction.fromOptionalString(environment.getArgument("direction")).orElse(null);
}
};
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A specific task under Pagination and Sorting #103 is to enable such support for the Querydsl and Query By Example data integrations. This involves the following tasks:
QuerydslDataFetcher
andQueryByExampleDataFetcher
to support pagination.@SchemaMapping
methods too, so this could be some shared.The text was updated successfully, but these errors were encountered: