GithubHelp home page GithubHelp logo

apollo-kotlin-tutorial's Introduction

Apollo Kotlin Tutorial

Repository for the Apollo Kotlin tutorial.

The tutorial is available through our documentation site. This repository contains the corresponding code.

For copy errors in the tutorial, please file bugs against the main apollo-kotlin repo. For broken code, please file issues on this repo.

apollo-kotlin-tutorial's People

Contributors

bod avatar designatednerd avatar martinbonnin avatar smyrick avatar svc-secops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apollo-kotlin-tutorial's Issues

Scalar Verifier isssue

Getting The below issue when response is being converted to data class by apollo:

fromJson(com.apollographql.apollo3.api.json.JsonReader, com.apollographql.apollo3.api.CustomScalarAdapters) failed to verify:ArrayList[data]
at com.nw18.data.repository.ILanguageTranslationRepositoryImpl$getLanguageTranslationData$2.invokeSuspend(ILanguageTranslationRepositoryImpl.kt:26)
	at com.nw18.data.repository.ILanguageTranslationRepositoryImpl$getLanguageTranslationData$2.invoke(Unknown Source:8)
	at com.nw18.data.repository.ILanguageTranslationRepositoryImpl$getLanguageTranslationData$2.invoke(Unknown Source:4)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collect$suspendImpl(ChannelFlow.kt:167)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collect(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invokeSuspend(Merge.kt:27)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:8)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:4)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest.flowCollect(Merge.kt:25)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@317f5d6, Dispatchers.IO]

Modernize the Tutorial

Make the tutorial use Jetpack Compose by default (keep the view based version as a separate branch).

Following Tutorial - End of Step 1 issue

Following the tutorial here: https://www.apollographql.com/docs/kotlin/tutorial/01-configure-project

At the end of step 1 it says:

Android Studio will display a yellow banner, A project sync may be necessary for the IDE to work properly. Click Sync Now.

If everything goes well, Apollo Kotlin is now added to your project. Next, you will add the GraphQL schema to the project.

Clicks Sync Now

However you get the error

No schema file found in:
src/main/graphql

image

Which seems to be step 2 of the tutorial. Just a heads up.


After completing step 2 (i.e. running the command ./gradlew :app:downloadApolloSchema --endpoint='https://apollo-fullstack-tutorial.herokuapp.com/graphql' --schema=app/src/main/graphql/schema.graphqls), the project sync's successfully.

Cannot find a Java/Kotlin extension, please apply the kotlin or java plugin

Hi! I've been trying to get the tutorial setup for several hours now between yesterday and today. I cloned and followed the initial steps located on here: https://www.apollographql.com/docs/kotlin/tutorial/01-configure-project#clone-the-starter-project

Right away I was getting this error:

errorMessage

I'm getting this error even on the 'main' branch which is supposed to be the "final" and completed project according to the tutorial. I think something may be outdated. I've tried several different methods of "setting up" Kotlin plugins and extensions found on the Kotlin docs, Android docs, and stack overflow, but none fixed this issue for me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.