Apollo-Android
16
query {
viewer {
login
bio
status {
emoji
message
}
}
}
data class Viewer(
val __typename: String = "User",
/**
* The username used to login.
*/
val login: String,
/**
* The user's public profile bio.
*/
val bio: String?,
/**
* The user's description of what they're
currently doing.
*/
val status: UserQuery.Status?
)
Slide 17
Slide 17 text
Depreciation
17
query {
pinnedRepositories {
nodes {
id
}
}
}
/**
* A list of repositories this user
has pinned to their profile
*/
@Deprecated(message =
"pinnedRepositories will be
removed Use ProfileOwner.pinnedItems
instead. Removal on 2019-10-01 UTC.")
val pinnedRepositories:
PinnedRepositories
Slide 18
Slide 18 text
Runtime
18
val client = ApolloClient.builder()
.serverUrl("https://api.github.com/graphql")
.build()
val viewer = runBlocking {
client.query(UserQuery())
.toDeferred()
.await()
.data()
.viewer()
}