Expose GraphQL field with different name (#12289)

This commit is contained in:
Muhammad Abdullah Azam Khan
2022-06-01 01:35:54 +04:00
committed by GitHub
parent 97b2c4d6ea
commit aef4affc28
3 changed files with 7 additions and 0 deletions
@@ -12,4 +12,9 @@ public class PostResolver implements GraphQLResolver<Post> {
public Author getAuthor(Post post) {
return authorDao.getAuthor(post.getAuthorId()).orElseThrow(RuntimeException::new);
}
public Author getFirst_author(Post post) {
return authorDao.getAuthor(post.getAuthorId()).orElseThrow(RuntimeException::new);
}
}
@@ -4,6 +4,7 @@ type Post {
text: String!
category: String
author: Author!
first_author: Author!
}
type Author {