/quack-frontend

Notus NextJS: Free Tailwind CSS UI Kit and Admin

Primary LanguageJavaScriptMIT LicenseMIT

Quack Frontend Website

Origin project please refer: Notus NextJS

Apollo Clinet two-way

  1. Directly using:
import { gql } from "@apollo/client";
import client from "../apollo-client";
import { useEffect } from "react";

useEffect(() => {
  (async () => {
    const { data } = await client.query({
      query: gql`
        query Countries {
          countries {
            code
            name
            emoji
          }
        }
      `,
    });
    console.log(data);
  })();
}, []);
  1. By hook
import ClientOnly from "../../components/Apollo/ClientOnly";
import Countries from "../../components/Logics/Countries";


<ClientOnly>
  <Countries />
</ClientOnly>