Total graphql noob here. I have an Android Java app that works. I want to make a query to a graphql server (podchaser.com). I was following the Client (Kotlin) v3 docs (though I don’t know or use Kotlin). In the Write your first query section, when I built the project, Apollo generated Java classes.
I created a Java class to create an ApolloClient and a method to execute my query. The execute query method failed on build:
- public static Single<ApolloResponse> executePodcastSearchQuery( String searchTerm ) {
The error is:
Type parameter 'com.alcyonltd.droid.osmium.podchaser.PodcastSearchQuery.Data' is not within its bound; should implement 'com.apollographql.apollo3.api.Operation.Data'
If I edit the PodcastSearchQuery.Data class to add Operation.Data as instructed (I know that the generated files are not to be edited), my execute method then shows no errors.
So, I can never run the app because the PodcastSearchQuery.Data class is regenerated every time without implementing Operation.Data causing the build to fail.
Is there a way around this?