Comments (9)
The problem seems to be on client. Using the curl on terminal, the information was returned.
The problem has to do with client, probably in the way that information is provided to children
from foton-mobile.
why?
could be related to data mask
could share piece of code or link?
how is the result from the query?
from foton-mobile.
Here is the root query of App when authenticated:
const isAuth = true;
const Routes = createRouter(isAuth);
if (isAuth) {
const Root = () => {
const query = useQuery(graphql`
query AppQuery {
...Dashboard_products
}
`);
return <Routes />;
};
const RootWrapper = () => {
return (
//@ts-ignore
<ErrorBoundaryWithRetry
fallback={error => <ErrorScreen error={error.message} />}
>
<React.Suspense fallback={<LoadingScreen />}>
<Root />
</React.Suspense>
</ErrorBoundaryWithRetry>
);
};
return <RootWrapper />;
Relay finds the fragment and send requisition to server.
But the const that receive useFragment, products appears as null.
const products = useFragment(
graphql`
fragment Dashboard_products on Query {
products(first: 10) @connection(key: "Dashboard_products") {
edges {
node {
id
name
description
}
}
pageInfo {
hasNextPage
startCursor
}
}
}
`,
props.products,
);
from foton-mobile.
try to copy the curl from network tabe
and test it through terminal
if there is no data, the problem is on backend
if there is data, the problem is on client
from foton-mobile.
nice
how can we debug it on client?
which methods of relay-experimental are you using?
do you have any link to the code where this problem is happening?
from foton-mobile.
I am using useQuery
. In the relay-examples-hooks repo, I saw the UseLazyLoadingQuery
, but it didn't come with relay-experimental. Could that be the issue?
The parts of the code where this problem is coming from are use Fragment
and UseQuery
.
I think the best way to debug is focusing on the useFragment hook. Sometimes that warning shows and sometimes it doesn't show.
from foton-mobile.
the problem is data masking:
data asked by the fragment won't be available on it's parent
this is a relay feature
components have access to the data they ask for and that's it
from foton-mobile.
But how could we have access to data? Since here the root component won't have the information.
from foton-mobile.
colocation
each component ask for the data they will use
a component should not ask for data that won't be used
from foton-mobile.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foton-mobile.