Hello! How do you make type safe requests with Ktor on both the secret and the client? Do you simply put the content negotiation and resources classes in a shared module and call it good enough?
c
Cies
04/20/2023, 1:08 PM
secret = server? I did this type of thing with OpenAPIv3 and GraphQL: two ways to achieve fully type API barriers. Bonus these two provide ways to generate client libs in a plethora of languages.
i
Isak Hansson
04/20/2023, 1:10 PM
Yes sorry typo. Did you implement both a Ktor server and GraphQL server then?
Isak Hansson
04/20/2023, 1:12 PM
My use case is for the server to be the backend of multiple Kotlin Multiplatform apps. Don't see the value of GraphQL when everything is already in Kotlin.
c
Cies
04/20/2023, 1:21 PM
I was more commenting on typed APIs in general. GraphQL i used with Hasura on the server side.
Cies
04/20/2023, 1:22 PM
But in an all Kotlin situation I'd make a shared folder with DTOs used by both client and server.