Example for a GraphQL Application in Spring Boot (#2477)
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
04fa1782a2
commit
706b3d6c67
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user