18 lines
393 B
Java
18 lines
393 B
Java
|
|
package com.baeldung.graphql;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
|
||
|
|
|
||
|
|
public class Query implements GraphQLQueryResolver {
|
||
|
|
private PostDao postDao;
|
||
|
|
|
||
|
|
public Query(PostDao postDao) {
|
||
|
|
this.postDao = postDao;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<Post> recentPosts(int count, int offset) {
|
||
|
|
return postDao.getRecentPosts(count, offset);
|
||
|
|
}
|
||
|
|
}
|