Here's your chance to speak at GraphQL Summit in New York City, October 8 - 10, 2024! 🏙️ Submit your proposal by May 31.
Docs
Launch GraphOS Studio
You're viewing documentation for an upcoming version of this software. Switch to the latest stable version.

Client Awareness


users can opt-in Client Awareness. Client Awareness allows you to view metrics split per client, helping you understand how each one interacts with your .

Client Awareness uses apollographql-client-name and apollographql-client-version custom HTTP headers to report client usage.

Enable it by adding an ApolloClientAwarenessInterceptor to your OkHttpClient:

val apolloClient = ApolloClient.Builder()
.serverUrl("https://example.com/graphql")
.addHttpInterceptor(ApolloClientAwarenessInterceptor(BuildConfig.APPLICATION_ID, BuildConfig.VERSION_NAME))
.build()

Note: This example uses BuildConfig to set the applicationId as client name and app version as client version but you can override this. Especially, if your iOS and Android apps use the same package name, it's useful to customize it to allow differentiating the clients

Previous
File types
Next
Multi Modules
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company