apollo-kotlin: provided sha does not match query even after disabling enableAutoPersistedQueries for apolloclient

 ApolloClient.builder()
                .serverUrl(Endpoints.GRAPHQL_BASE_URL)
                .httpCache(new ApolloHttpCache(cacheStore))
                .defaultHttpCachePolicy(HttpCachePolicy.NETWORK_ONLY)
                .addCustomTypeAdapter(CustomType.DATE, getCustomDateAdapter())
                .addCustomTypeAdapter(CustomType.CURSOR, getCustomCursorAdapter())
                .enableAutoPersistedQueries(false)
                .okHttpClient(client)
                .build(); 

Even after disabling persistedqueries() option it still produces the same error and I haven’t been able to make any request.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@vthakur1993 would you mind opening up this issue again?

v1.0.0-alpha4 still doesn’t work properly for us, we keep getting provided sha does not match query error.

If you:

  • need to use the most recent version (e.g. due to Gradle 5.0 support)
  • have issues with SHA generation
  • don’t need auto persisted queries

use this version:

buildscript {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }

    dependencies {
        classpath "com.apollographql.apollo:apollo-gradle-plugin:1.0.1-SNAPSHOT"
    }
}

 
repositories {
      maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

dependencies {
    implementation 'com.apollographql.apollo:apollo-runtime:1.0.1-20181206.012104-45'
    ...
}

(you probably also want to use a specific plugin version)