Apollo client is now accesible
This commit is contained in:
parent
6d99fab472
commit
71c1611e3e
@ -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()
|
||||
|
||||
}
|
@ -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}")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user