Skip to content

jguo1002/learn-relay-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

learn-relay-graphql

Relay Introduction

GraphQL & Relay in the Front End

Explaining GraphQL Connections

In GraphQL what's the meaning of "edges" and "node"?

Resources

awesome-graphql

Public GraphQL

8 Free to Use GraphQL APIs for Your Projects and Demos

SpaceX-pxxbxen@current

CodeGen

npx get-graphql-schema http://127.0.0.1:8000/ > schema.graphql

Example

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>
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published