menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

How to modify request body "extensions" field in Apollo Android

February 11, 2021 at 6:48pm
The Apollo community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →

How to modify request body "extensions" field in Apollo Android

February 11, 2021 at 6:48pm (Edited 3 months ago)
I'm trying to modify the request body "extensions" field and add an extra value along with "persistedQuery". Questions :
  1. What's the best approach to do this in Apollo?
  2. Can it be done at the per-request level, similar to what we have for headers (requestHeaders(header) in ApolloQueryCall)

February 11, 2021 at 7:13pm
Hi 👋. I don't think we have APIs for that. Do you mind opening an issue so we can track this? As a workaround, you can patch your json to add extensions from an OkHttpInterceptor. That will decode/reencode your json but depending the size of it, that might be acceptable.
  • reply
  • like
Hi (mbonnin) Thank you for the quick response and the workaround. Created an issue to track it [https://github.com/apollographql/apollo-android/issues/2922].
like-fill
1
  • reply
  • like