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
|
package org.dnss.sfs.git.wdg.noise
|
||||||
import com.apollographql.apollo3.ApolloClient
|
import com.apollographql.apollo3.ApolloClient
|
||||||
|
|
||||||
class Apollo {
|
|
||||||
|
|
||||||
val apolloClient = ApolloClient.Builder()
|
val apolloClient = ApolloClient.Builder()
|
||||||
.serverUrl("https://noise.sfs.ddnss.org/graphql")
|
.serverUrl("https://noise.sfs.ddnss.org/graphql")
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
}
|
|
@ -8,7 +8,8 @@ import android.view.ViewGroup
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
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
|
import org.dnss.sfs.git.wdg.noise.databinding.FragmentGalleryBinding
|
||||||
|
|
||||||
class GalleryFragment : Fragment() {
|
class GalleryFragment : Fragment() {
|
||||||
@ -38,9 +39,9 @@ class GalleryFragment : Fragment() {
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
lifecycleScope.launchWhenResumed {
|
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