Hi Guys,
I have the following bit of code that shows the GraphQL results OK in the java console. However, I’d like to render the results in the browser window as well. What’s the best way to do this?:
import React from ‘react’;
import { useQuery, gql } from ‘@apollo/client’;
const WEATHER_QUERY = gql query CITY { something { here { ... { ... } } } }
;
const Index = () => {
const { loading, error, data } = useQuery(WEATHER_QUERY);
console.log(data);
if (loading) return
Loading…
;if (error) return
Error…
;return
{data.something.here}
};
export default Index;