Hello guys in this tutorial I'll show how to use the graphql so we need the plugin apollo graphql and import the Apollo runtime and we
need to pass our package I use the Poke API graphql so we have the schema and the query that we want to use I'll test the query this is our response we open the terminal and we copy this just change the schema and we paste and we run in the app, source, main, graphql this schema is created and we create our query so we copy the query and we also need the graphql plugin so we go in file, settings, plugins and we search for graphql and we download this plugin in our model we have the Poke species with the ID and name and we have a function to map the query to the poke specie in the module we provide the Apollo client passing the server URL and we provide the repository in the graphql client class inject the Apollo client and we get the Poke spieces emit the graphql result loading the result contains success, error and loading so we try to get the response we use the Apollo client and query and we pass our query we can see the query location in the app, build, generated, source, apollo in app, build generated source apollo and here we have the class and we use execute to collect the
Apollo response we get the list using the data and species and we emit the success list or
we send the error we have the repository with the function and the implementation then we inject the graphql client and we get the Poke spieces in the view model we inject the repository and we use state flow with the graph state that contain the data, isLoading and error message we use the repository and get the Poke spiece then we map the result when the result is Success I'll pass the data we use the stateIn with the viewmodel scope initial value and started in the screen we collect the
state and we can pass the list in the Lazy column