Comments (6)
Can you try whether this is still an issue with 0.3.0-next1 please? You can install it using the βnextβ tag.
from urql.
Yea, still doing it on 0.3.0-next1.
When I add if (data) console.log("test");
inside the render prop, then fire the mutation once (via onClick), I see this in the console:
Seems a little excessive.
from urql.
I think we'd need a reproduction on CodeSandbox to confirm this. There's only two calls to setState
as a result of a mutation. Although afterwards a refetch on the query might cause two additional, but separate, rerenders of course.
There's also the case of calling query
and mutation
inline in your render method. This way you might accidentally trigger a refetch or an update (the latter in the best case scenario), so try to pull that out of your component, if possible, or into an instance variable and see if it improves the situation.
https://github.com/FormidableLabs/urql/blob/master/src/components/client.tsx#L57-L62
from urql.
@mellogarrett any update? It'd be great if we could get a CodeSandbox running for this
from urql.
Hey @kitten I'm sorry, I ended up just using Axios to make graphql requests from componentDidMount
rather than on every render via urql's render prop.
from urql.
@mellogarrett Alright, since this is not reproducible right now and stale I'll close the issue. Sorry about that, let's see if someone else hits a similar case in the future
from urql.
Related Issues (20)
- useQuery in Nextjs Client Component should be executed from the client side HOT 3
- Passing a `Headers` object results in an error
- Possible memory leak when using multiple queries on the same page HOT 7
- requestPolicyExchange does not re-request in production HOT 3
- cacheExchange - cache.readQuery (updateQuery) can't find queries with aliased variables HOT 1
- @urql/exchange-persisted Module name, 'crypto' does not resolve to a valid URL. HOT 7
- Non RSC authExchange failing HOT 2
- Problem: @urql/exchange-graphcache updateCacheWithResult reads null after writing link in cache updater. HOT 8
- Invalidating cache in Graphcache doesn't trigger query refetch in Next.js app router HOT 2
- RFC: react native file upload support HOT 1
- Introspected schema from urql-introspection doesn't match type of exchange-graphcache HOT 1
- RFC: Graphcache strong typing HOT 3
- Graphcache: mutations with different files in parallel, results lost HOT 2
- Invalidate with a key does not produce expected result HOT 2
- RFC: Normalize embedded documents based on parent HOT 5
- Syntax Error: Unexpected token in SelectionSet HOT 1
- RFC: @urql/vue - Allow getter syntax in `useQuery` HOT 4
- RFC: Add secondary keys
- @urql/exchange-graphcache returns empty data & error although fetch response contains valid data. (when same entity is requested in parallel) HOT 1
- Multiple requests when using react suspense HOT 13
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 urql.