From 71c1611e3e3dae41eef2f663ed2ea84353156400 Mon Sep 17 00:00:00 2001 From: peet Date: Tue, 11 Jan 2022 18:25:00 +0100 Subject: [PATCH] Apollo client is now accesible --- app/src/main/java/org/dnss/sfs/git/wdg/noise/Apollo.kt | 4 ---- .../dnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/dnss/sfs/git/wdg/noise/Apollo.kt b/app/src/main/java/org/dnss/sfs/git/wdg/noise/Apollo.kt index f141335..5b7b7e0 100644 --- a/app/src/main/java/org/dnss/sfs/git/wdg/noise/Apollo.kt +++ b/app/src/main/java/org/dnss/sfs/git/wdg/noise/Apollo.kt @@ -1,10 +1,6 @@ package org.dnss.sfs.git.wdg.noise import com.apollographql.apollo3.ApolloClient -class Apollo { - val apolloClient = ApolloClient.Builder() .serverUrl("https://noise.sfs.ddnss.org/graphql") .build() - -} \ No newline at end of file diff --git a/app/src/main/java/org/dnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt b/app/src/main/java/org/dnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt index 6655e62..b497016 100644 --- a/app/src/main/java/org/dnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt +++ b/app/src/main/java/org/dnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt @@ -8,7 +8,8 @@ import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope -import org.dnss.sfs.git.wdg.noise.Apollo +import org.ddnss.sfs.git.wdg.noise.GetUsersQuery +import org.dnss.sfs.git.wdg.noise.apolloClient import org.dnss.sfs.git.wdg.noise.databinding.FragmentGalleryBinding class GalleryFragment : Fragment() { @@ -38,9 +39,9 @@ class GalleryFragment : Fragment() { super.onViewCreated(view, savedInstanceState) lifecycleScope.launchWhenResumed { - val response = Apollo.apolloClient.query(getUsers()).execute() + val response = apolloClient.query(GetUsersQuery()).execute() + - Log.d("getUsers", "Data:: ${response.data}") } }