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 am trying to build a Spring Boot, GraphQL, Exposed app.
Those are my two test(!) Entities:
object AuctionHouseTable : UUIDTable("auction_house") {
val name = text("name").uniqueIndex()
val description = text("description").nullable()
val url = text("url").nullable().uniqueIndex()
}
classAuctionHouse(id:EntityID<UUID>): UUIDEntity(id) {
companionobject:UUIDEntityClass<AuctionHouse>(AuctionHouseTable)
var name by AuctionHouseTable.name
var description by AuctionHouseTable.description
var url by AuctionHouseTable.url
}
object AuctionHouseLocationTable: UUIDTable("auction_house_location") {
val auctionHouse = reference("fk_auction_house", AuctionHouseTable)
val locationDetail = text("location_detail").nullable()
}
classAuctionHouseLocation(id:EntityID<UUID>): UUIDEntity(id) {
companionobject:UUIDEntityClass<AuctionHouseLocation>(AuctionHouseLocationTable)
var auctionHouse by AuctionHouse referencedOn AuctionHouseLocationTable.auctionHouse
var locationDetail by AuctionHouseLocationTable.locationDetail
}
Also I am using spring-transactions and HikariCP. Querying a single entity works, no need for transaction { }.
When trying to query
query {
getAuctionHouseLocations {
id
locationDetail
auctionHouse {
name
}
}
}
I am getting java.lang.IllegalStateException: No transaction in context.. I guess, this has something to do with GraphQL not being able to initiate lazy loading.
funfindAll(): List<AuctionHouseLocation> {
val list =AuctionHouseLocation.all().toList()
for (auctionHouseLocation in list) {
println("Auction House name ${auctionHouseLocation.auctionHouse.name}")
}
return list
}
in my repository, Exposed correctly prints the name and executes the additional sql statement, but this is not the same context GraphQL tries to use, I guess.
Has anyone been able to use GraphQL with Exposed+Spring Boot (and DAO, not DSL)?
The text was updated successfully, but these errors were encountered:
I am trying to build a Spring Boot, GraphQL, Exposed app.
Those are my two test(!) Entities:
Also I am using spring-transactions and HikariCP. Querying a single entity works, no need for transaction { }.
When trying to query
I am getting
java.lang.IllegalStateException: No transaction in context.
. I guess, this has something to do with GraphQL not being able to initiate lazy loading.When I change
to
in my repository, Exposed correctly prints the name and executes the additional sql statement, but this is not the same context GraphQL tries to use, I guess.
Has anyone been able to use GraphQL with Exposed+Spring Boot (and DAO, not DSL)?
The text was updated successfully, but these errors were encountered: