'use client'; import createApolloClient, { queryCountries, } from '@/app/demos/graphql/apollo-client'; import { ApolloProvider, useQuery } from '@apollo/client'; const client = createApolloClient(); export default function Client() { return ( ); } function Countries() { const { data, loading, error } = useQuery(queryCountries); if (loading) { return

Loading...

; } if (error) { console.error(error); return null; } const countries = data.countries.slice(0, 4); return (
{countries.map((country: any) => (

{country.name}

{country.code} - {country.emoji}

))}
); }