Skip to content

Instantly share code, notes, and snippets.

@aronbalog
Last active July 26, 2019 19:25
Show Gist options
  • Save aronbalog/cea468164c8e3d697fb41a795e28d3dc to your computer and use it in GitHub Desktop.
Save aronbalog/cea468164c8e3d697fb41a795e28d3dc to your computer and use it in GitHub Desktop.
package com.example.demo.graphql.query
import com.coxautodev.graphql.tools.GraphQLQueryResolver
import com.example.demo.dao.PersonDao
import com.example.demo.data.Person
import org.springframework.stereotype.Component
@Component
class PersonQueryResolver(
private val personDao: PersonDao
): GraphQLQueryResolver {
fun person(id: String) =
personDao.getPersonById(id)
fun personsByName(name: String) =
personDao.getPersonsByName(name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment