unlocomqx/svelte-apollo-client

How do I get the result of the query?

Opened this issue · 2 comments

hello, I am building a login workflow, but the result of the query on the backend is returning functions. How to get the result instead?

This is intended to be used in the browser, not on the backend.
I didn't try it on the server

i canot get result data from query

my Code:

<script>
import { SvelteApolloClient } from "svelte-apollo-client";
import { InMemoryCache } from "@apollo/client/core";

   import { gql } from "@apollo/client/core";

 const client = SvelteApolloClient({
  uri: "https://graphql.contentful.com/content/v1/spaces/hsb6hcp4u643/explore?access_token=-q8KutJny9G02QUV2oMOL9lsei3_fvu7BJ-MEs68L0U",
  cache: new InMemoryCache(),
});
    let rates;

  function getRates() {
    rates = client.query(gql`
     {
  modelSekolahCollection{
    items{
      id
      nama
      gambar {
        title
        description
        contentType
        fileName
        size
        url
        width
        height
      }
    }
  }
}
    `);
    console.log(rates)
  }
</script>
<button on:click={getRates}>Get rates</button>

MY CONSOLE:
{subscribe: ƒ, fetchMore: ƒ, getCurrentResult: ƒ, getLastError: ƒ, getLastResult: ƒ, …}