Dariusz Kuc
10/17/2023, 4:34 PMSupercharge your GraphQL with Ktor and GraalVM
at https://windycity.devfest.io/ (free event) next week. If you are in Chicago next Tuesday 10/24 -> stop by to say hiS.
11/12/2023, 12:00 AMAll types within a GraphQL schema must have unique names. No two provided types may have the same name.
No provided type may have a name which conflicts with any built in types (including Scalar and Introspection types).
You have redefined the type 'LocalDateTime' from being a 'GraphQLScalarType' to a 'GraphQLScalarType'
S.
11/13/2023, 7:37 PMFrancois
11/27/2023, 6:06 PMFrancois
11/27/2023, 6:07 PMskennedy
12/29/2023, 6:26 PMDariusz Kuc
03/06/2024, 8:29 PMMitchell Syer
03/10/2024, 11:04 PMdany giguere
03/12/2024, 10:56 PM@GetMapping("/posts/{id}")
suspend fun getById(@PathVariable id: Long): ResponseEntity<PostDto> {
val response = postService.findById(id)
return if (response != null) ResponseEntity.ok(response)
else ResponseEntity.notFound().build()
}
I’d like to convert the project to use GraphQl. (it will be in a different demo of course with a bff and microservices)Mitja Debeljak
04/04/2024, 11:41 AMobject ProductTable : IntIdTable() {
val name = varchar("name", 80)
val price = double("price")
}
class ProductEntity(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<ProductEntity>(ProductTable)
var name by ProductTable.name
var price by ProductTable.price
}
...
class ProductQuery : Query {
private val repository = ProductRepository()
suspend fun products(): List<Product> = repository.findAll()
}
...
class ProductRepository {
suspend fun findAll(): List<Product> = query {
val products = ProductEntity.all().map { entityToProduct(it) }
products
}
}
When I build a native image and run it against a query that is calling this oblect, I get this error:
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Could not compute caller for function: public constructor ProductEntity(id: org.jetbrains.exposed.dao.id.EntityID<<http://kotlin.Int|kotlin.Int>>) defined in si.schlamberger.climbholds.db.product.ProductEntity[DeserializedClassConstructorDescriptor@733818e6] (member = null)
Mitja Debeljak
04/04/2024, 11:42 AMtypeHierarchy = mapOf(
IntEntity::class to listOf(ProductEntity::class),
IntIdTable::class to listOf(ProductTable::class)
)
but does not help. I probably do not understand enough how reflection work, to define this correctly.Aman Agarwal
04/14/2024, 3:07 AM@GraphQLInputName
which is expected to override the default behaviour of appending Input
as suffix in the input classes.
Here is the changes which I have made
https://github.com/ExpediaGroup/graphql-kotlin/pull/1949/files
I am trying to test these changes in one of my service where I have generated the jar graphql-kotlin-schema-generator
and updated it's generated version into my pom, I have written the test cases those are working as expected but when I am applying this annotation in service my schema.graphql
is not showing the changes as expected. Could you please help to know what I am missing?Aman Agarwal
04/16/2024, 5:46 PMgraphql-kotlin-maven-plugin
locally, I build it's jar and installed it into local maven and updated the version in my service but getting below error
Execution default of goal com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT:generate-sdl failed: A required class was missing while executing com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT:generate-sdl: kotlin/jvm/functions/Function0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/amaagarwal/.m2/repository/com/expediagroup/graphql-kotlin-maven-plugin/8.0.0-SNAPSHOT/graphql-kotlin-maven-plugin-8.0.0-SNAPSHOT.jar
[ERROR] Number of foreign imports: 1
Can someone help, if there is another way to test it?Dušan Salay
05/02/2024, 9:15 AMgraphqlGenerateClient
gradle task. I set all required properties:
val graphqlGenerateClient by tasks.getting(GraphQLGenerateClientTask::class) {
packageName.set("org.harmonelo.moneys4.graphql")
schemaFile.set(file("${project.projectDir}/src/main/resources/schema.graphql"))
}
task run ends up successful ✅ but I don’t see any generated classes.
Only what I spotted is empty folder in build folder: (attached img)
Can you pls give me advise what am I doing wrong? 🙉Dariusz Kuc
05/07/2024, 2:57 PMgraphql-java
that has a required fix and is currently targeting june/july timeframe) -> if you are interested in testing stuff out, we just dropped a new version that uses patched version of graphql-java
v22 which should bring some nice perf improvements (v22 no longer needs to wrap everything in completable futures). Check it out -> https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/8.0.0-alpha.1
*we'll most likely do some other cleanups around deprecated stuffDušan Salay
06/06/2024, 6:35 AM{
"Data": {
"CreateIssuedInvoice": {
"ID": "62d0e9c6-1c54-4324-8ac5-716701b325be",
"Stav": 0,
"CisloDokladu": "240010989"
}
},
"Status": 1,
"Message": "",
"StackTrace": ""
}
but default deserialisation of GraphQLWebClient
is unable to parse it.
I assume that’s is because of first uppercase letter? Is here any possible workaround how to fix that?S.
07/29/2024, 9:18 AMquery {sessions(dateRange: {range: "2024-06-28/2024-07-28"})}
work, but if I use a variable instead query ($dateRange: DateRangeInput) {sessions(dateRange: $dateRange)}
( with "dateRange": {"range": "2024-06-28/2024-07-28"}
) it does not?Thomas Bakker
07/31/2024, 12:03 PMspring-graphql
to allow MVC support, but can’t find anything recent. We have an old project that’s based on Spring Boot 2.4 (MVC) and graphql-kotlin 2.1 that I’m trying to upgrade.
Or maybe someone has experience integrating the library (or schema generator) with an MVC project 🙂Dariusz Kuc
09/09/2024, 9:03 PM1 MDC.put("k1", "v1")
2 <http://logger.info|logger.info>("one")
3 withContext(<http://Dispatchers.IO|Dispatchers.IO> + MDCContext()) {
4 MDC.put("k2", "v2")
5 <http://logger.info|logger.info>("two")
6 delay(10000) // Fake an API call
7 <http://logger.info|logger.info>("three")
8 }
9 <http://logger.info|logger.info>("four")
given the above I believe the behavior would be -
• when calling the function we got initial MDC value
• lines 1&2 will run on the same thread with updated MDC { "k1": "v1" }
• then at line 3 we start the coroutine which MAY change the thread
• our MDC context of this coroutine is { "k1": "v1" }
• 4 & 5 will run on the same thread with modified MDC { "k1": "v1", "k2": "v2" }
• 6 is suspendable call and once it returns it may resume on a different thread
• 7 resets the MDC back to { "k1": "v1" }
(from line 3)
• we are back to main logic where we may run on a different thread which then uses MDC context from when we entered the function (i.e. initial MDC)
and yes in order to have consistent logging behavior you would have to restore the MDC after each suspension point
see the docs -> https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-slf4j/kotlinx.coroutines.slf4j/-m-d-c-context/S.
11/11/2024, 11:45 AMade
01/15/2025, 10:21 AMabhinandan chivate
01/22/2025, 4:44 AMPreetam
02/16/2025, 12:50 AMgraphql-kotlin-ktor-server
lib, and I get the updates successfully in graphiql console.
but when I try to use subscriptions on client using apollo client, I don't get any data
I tried using both <ws://localhost:4000/graphql>
and <ws://localhost:4000/subscriptions>
when I try to connect using wscat -c <ws://localhost:4000/subscriptions>
I get error: Unexpected server response: 400
I have followed this https://www.apollographql.com/tutorials/apollo-kotlin-android-part2/08-subscriptions with no success.Joe
04/15/2025, 6:01 PMIMPORTANT
see <https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/8.3.0>
but that leads to a 404? looks like some of the post 8.2.1 tags are now relabeled as 9.0.0-alpha.x releases but unclear as a consumer what's actually happening?phldavies
04/15/2025, 6:09 PMSamuel Vazquez
04/15/2025, 6:36 PMSamuel Vazquez
04/15/2025, 6:41 PMphldavies
04/15/2025, 6:43 PMSamuel Vazquez
04/15/2025, 6:44 PMLucas Fugisawa
04/17/2025, 11:30 PM