You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just started with graphql and have a question about this tutorial.
I don't really see the purpose of the GraphQLProvider class. Especially the method buildWiring(). As far as I can see the graphql-spring-boot-starter is doing the initialization and wiring automagically.
The following code is working fine for me:
@Component
@RequiredArgsConstructor
public class Query implements GraphQLQueryResolver {
private final AuthorRepository authorRepo;
private final BookRepository bookRepo;
public Author getAuthor(Long id) {
return authorRepo.findById(id).orElse(null);
}
public Book getBook(Long id) {
return bookRepo.findById(id).orElse(null);
}
}
Is there any benift of defining the DataFetchers manually? Or is this tutorial just outdated?
The text was updated successfully, but these errors were encountered:
I just started with graphql and have a question about this tutorial.
I don't really see the purpose of the
GraphQLProvider
class. Especially the methodbuildWiring()
. As far as I can see thegraphql-spring-boot-starter
is doing the initialization and wiring automagically.The following code is working fine for me:
Is there any benift of defining the DataFetchers manually? Or is this tutorial just outdated?
The text was updated successfully, but these errors were encountered: