question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

apollo-kotlin fails when using refreshVersions

See original GitHub issue

🐛 Describe the bug

Apollo checks to make sure all versions are equal: https://github.com/apollographql/apollo-kotlin/blob/a1536a269ffe5896f1b5290e55bd361e2d398861/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt#L167

This check fails when using refreshVersions.

This can be worked around by using versionFor in the dependencies.

⚠️ Current behavior

This results in the generateApolloSources task giving the following error:

Apollo: All apollo versions should be the same. Found:
  [3.1.0, _]

✅ Expected behavior

The version check to succeed.

💣 Steps to reproduce

Configuration:

buildscript {
    ...
    dependencies {
        ...
        classpath("com.apollographql.apollo3:apollo-gradle-plugin:_")
    }
}
plugins {
    ...
    id("com.apollographql.apollo3")
}

dependencies {
    implementation("com.apollographql.apollo3:apollo-runtime:_")
    implementation("com.apollographql.apollo3:apollo-adapters:_")
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
imashnake0commented, Mar 29, 2022

Fixed in 3.2.0 🎉.

1reaction
martinbonnincommented, Feb 25, 2022

Thinking more about this, I’m having second thoughts… Resolving a configuration isn’t something trivial and I’m too afraid of potential side effects. Also, if for some reason, another unrelated dependency fails to resolve, this will show up with “checkApolloVersions” in the error, which could be misleading.

~I’m ok disabling the check if de.fayard.refreshVersions is applied (or maybe just filtering out ‘'). What do you think?~ Edit: never mind, this is what you said in your comment above. I’m just going to filter out '’ as a pragmatic first step. For disabling the check, see comment above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am facing this problem after upgrading to version 3 3 2 Us
I am facing this problem after upgrading to version 3 3 2 Users subhamtyagi gradle caches modules 2 files 2 1 com apollographql...
Read more >
apollo-kotlin/CHANGELOG.md at main - GitHub
Apollo Kotlin can be configured to work with multiple services and have the package ... Fix item wrongly removed from http cache when...
Read more >
Migrating to Apollo Kotlin 3.0 - Apollo GraphQL Docs
This page describes the most important changes, along with how to migrate an existing project from Apollo Android 2.x to Apollo Kotlin 3.x....
Read more >
How to build a GraphQL Gateway with Spring Boot and Kotlin
GraphQL-java-kickstart libraries. Use the source Luke. Note that I'm using gradle refreshVersions to make it easy to keep the project up-to-date ...
Read more >
Setup - gradle refreshVersions - GitHub Pages
Gradle 6.8+ is required because this plugin relies on Kotlin 1.4. ... If the command fails ... you probably want to use refreshVersions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found