Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Ktor receiver module for soil-query 🔨 #65

Merged
merged 1 commit into from
Aug 17, 2024
Merged

Conversation

ogaclejapan
Copy link
Contributor

We have developed a new Ktor receiver module for the Soil Query application. This module has been reimplemented from the existing Playground module and is now available as a public module. By integrating this module into your project, you can seamlessly incorporate the Ktor client functionalities in Soil Query.

SwrClient creation code:

val receiver = KtorReceiver(client = ktorClient)
val swrCache = SwrCache(policy = SwrCachePolicy(
  ..,
  queryReceiver = receiver,
  mutationReceiver = receiver,
  ..
))

Key creation code:

class GetPostKey(private val postId: Int) : QueryKey<Post> by buildKtorQueryKey(
    id = Id(postId),
    fetch = { /* io.ktor.client.HttpClient.() -> String */
        get("https://jsonplaceholder.typicode.com/posts/$postId").body()
    }
)

We have developed a new Ktor receiver module for the Soil Query application. This module has been reimplemented from the
existing Playground module and is now available as a public module. By integrating this module into your project, you
can seamlessly incorporate the Ktor client functionalities in Soil Query.
@ogaclejapan ogaclejapan added the enhancement New feature or request label Aug 17, 2024
@ogaclejapan ogaclejapan merged commit 4428ea4 into main Aug 17, 2024
1 check passed
@ogaclejapan ogaclejapan deleted the ktor-receiver branch August 17, 2024 06:24
@github-actions github-actions bot mentioned this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant