GraphQL & Relay in the Front End
Explaining GraphQL Connections
In GraphQL what's the meaning of "edges" and "node"?
8 Free to Use GraphQL APIs for Your Projects and Demos
npx get-graphql-schema http://127.0.0.1:8000/ > schema.graphql
Github Issue: Relay: loadQuery should not be called inside a React render function. #3449
loadQuery cannot be used in a function component
/*define appQuery*/
const Header = ({appQueryRef}:Props)=>{
const data = usePreloadedQuery(appQuery, appQueryRef)
return <h1>data.user</h1>
}
const App = () => {
const [appQueryRef, loadQuery] = useQueryLoader<AppQueryType>(appQuery);
if appQueryRef === null: return null;
return <Suspense fallback={<Loading...>}>
<Header appQueryRef = {appQueryRef} />
</Suspense>
}