Skip to content

apollographql/apollo-kotlin-adapters

Repository files navigation

Apollo Client

Discourse Slack

Maven Central OSS Snapshots

🚀 Apollo Adapters

Add to your project:

[libraries]
apollo-adapters-core = "com.apollographql.adapters:apollo-adapters-core:0.0.6"
apollo-adapters-kotlinx-datetime = "com.apollographql.adapters:apollo-adapters-kotlinx-datetime:0.0.6"

Apollo Kotlin Adapters contains adapters for common date and big decimal classes.

Warning

GraphQL scalar names and coercing may vary depending on your server implementation. The adapters are provided for convenience but may not map exactly what your server expects or returns. In those cases, feel free to copy/paste and adapt the implementation.

Adapter Artifact Kotlin type
BigDecimalAdapter apollo-adapters-core com.apollographql.adapter.core.BigDecimal
KotlinInstantAdapter apollo-adapters-core kotlin.time.Instant
JavaInstantAdapter apollo-adapters-core java.time.Instant
JavaLocalDateAdapter apollo-adapters-core java.time.LocalDate
JavaLocalDateTimeAdapter apollo-adapters-core java.time.LocalDateTime
JavaLocalTimeAdapter apollo-adapters-core java.time.LocalTime
JavaOffsetDateTimeAdapter apollo-adapters-core java.time.OffsetDateTime
JavaZonedDateTimeAdapter apollo-adapters-core java.time.ZonedDateTime
DateAdapter apollo-adapters-core java.util.Date
UnitAdapter apollo-adapters-core kotlin.Unit
KotlinxLocalDateAdapter apollo-adapters-kotlinx-datetime kotlinx.datetime.LocalDate
KotlinxLocalDateTimeAdapter apollo-adapters-kotlinx-datetime kotlinx.datetime.LocalDateTime
KotlinxLocalTimeAdapter apollo-adapters-kotlinx-datetime kotlinx.datetime.LocalTime

Because some adapters use kotlinx.datetime (which itself uses java.time), apollo-adapters-kotlinx-datetime requires core library desugaring on Android API levels < 26

📚 Documentation

The Kdoc API reference can be found at:
https://apollographql.github.io/apollo-kotlin-adapters/kdoc

About

Datetime, BigDecimal and other adapters for Apollo Kotlin

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages