Newer
Older
sample-spring-graphql / src / main / java / com / sample / resolver / SampleGraphQLQueryResolver.java
yhornisse on 8 May 2020 515 bytes Add Project
package com.sample.resolver;

import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.sample.type.Book;
import org.springframework.stereotype.Component;

@Component
public class SampleGraphQLQueryResolver implements GraphQLQueryResolver {
    public Book getBook(String bookId) {
        return Book.builder()
                .bookId(bookId)
                .name("ハルヒ")
                .author("キョン")
                .build();
    }

    public boolean live(){
        return true;
    }
}