import graphql.kickstart.tools.GraphQLQueryResolver import me.stegall.personalwebsiteapi3.models.Project import me.stegall.personalwebsiteapi3.repositories.ProjectRepository import org.springframework.data.mongodb.core.MongoOperations import org.springframework.stereotype.Component @Component class ProjectQueryResolver( val projectRepository: ProjectRepository, private val mongoOperations: MongoOperations ) : GraphQLQueryResolver { fun projects(): List<Project> { return projectRepository.findAll() } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter