While updating from alpha 6 to alpha 7 of the new ...
# apollo-kotlin
s
While updating from alpha 6 to alpha 7 of the new normalized cache (with Apollo 4.3.3), following the release notes guidance, I'm seeing the compiler error
Apollo: unknown foreign schema 'cache/v0.3'
for the following at the top of my updated
graphqls
file:
Copy code
extend schema
@link(url: "<https://specs.apollo.dev/kotlin_labs/v0.5>", import: ["BuiltIn", "@mapTo"])
@link(url: "<https://specs.apollo.dev/cache/v0.3>", import: ["@connection", "@typePolicy"])
Does this require an Apollo 5.0 alpha, or is there something else going on here?
m
Did you add the cache compiler plugin?
s
Ahh, my bad, I did have it already but the version was mismatched – https://github.com/apollographql/apollo-kotlin-normalized-cache/issues/216 strikes again, I know this is fixed in v5 though 😅
Thanks again Martin!
m
Sure thing!
As a quick workaround, I'm curious why this doesn't work:
Copy code
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:${libs.versions.apolloCache}")
It's technically exactly the same as
Copy code
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:1.0.0-alpha.5") { .. }
You might just be missing a call to `.get()`:
Copy code
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:${libs.versions.apolloCache.get()}")
(Because
libs.version.apolloCache
is an instance of some class that doesn't have a
toString()
)
s
Cheers,
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:${libs.versions.apolloCache.get()}")
does indeed work!
🙌 1