score:29
Accepted answer
the apollo docs do a poor job of stressing this fact, but when you call readquery
to get a previously fetched query from the store, if that query took any variables, you need to pass in those same variables to retrieve it. assuming the id returned by mutation is the fund's id, you should be able to just modify this line:
const data = proxy.readquery({
query: fundql.fundpagequery,
variables: { id: createfundmetrics.id },
});
Source: stackoverflow.com
Related Query
- Apollo-client (react) - Update on create mutation - "Can't find field Fund({}) on object (ROOT_QUERY)"
- express http: 500 error on graphql mutation to create user from apollo client in react
- refetchQueries in Mutation Component of React Apollo Client is not working?
- Apollo client update after mutation can't map over original result?
- Update apollo client with response of mutation
- Apollo client (react) - Cant update state on unmounted component
- React Apollo updating client cache after mutation
- React Apollo client prop refetchQueries after mutation
- How to wrap GraphQL mutation in Apollo client mutation component in React
- React Apollo Error: Invariant Violation: Could not find "client" in the context or passed in as an option
- Cannot find module 'caniuse-lite/dist/unpacker/agents' when running create react app
- Create react app Error: Cannot find module './locale'
- How to run a mutation on mount with React Apollo 2.1's Mutation component?
- How to use Apollo Client + React Router to implement private routes and redirection based on user status?
- Apollo client issues in next.js , javascript, graphql, react js
- Create React App cannot find tests
- Apollo client 2 with React couldn't make query
- React Apollo Error: No more mocked responses for the query: mutation
- GitHub Pages not able to update index.html meta tags with create react app(CRA)
- What causes an "React.Children.only expected to receive a single React element child." error in an apollo client rendered component
- React Apollo dynamically create query from state
- How to find the trigger that caused the update in React 16?
- Dynamically set GraphQL queries for React components with Apollo Client
- Does Apollo client optimistic update changes reference for every list item?
- Apollo client - local field with computed value from object
- How to update 1 field only without overwriting others fields on a nested Object on React Hooks use Reducer?
- Firing React Apollo mutation on page load
- React Apollo Client Query throwing error "Invalid prop `children` of type `array` supplied to `Query`, expected `function`"
- How do I create an array of unique field values in React with data from Firestore?
- React Apollo Client - modify query data before it goes to cache
More Query from same tag
- What is the best practice to use Oauth2, React, Node.js and Passport.js to authenticate user with Google sign on button?
- React JS: Upload Multiple Files
- ESLint with Arbnb config and Facebook Flow together
- Using JsZipUtils with NPM & React - file can't be imported
- How to Edit in react js while using mysql database
- Hide Div onClick when clicking outside the child div | ReactJS
- Is there any method through which I can know whether I have reached the end of the record while scrolling in Ag -grid?
- How to make checkmark stick to start of text? Tailwind
- How to display component using react-router <Prompt> to prevent or allow route change
- React/Mobx - component is re-rendering, but componentWillReceiveProps() is not being called
- Object not replacing using spread operator
- How to show Step next and previous without using Switch Case statement
- react-router-dom : updates url but does not render the new component
- Universal react rendering with a CDN and heroku
- OnClick Listeners not working after closing full-screen dialog using react-material-ui
- Setup multiple .env configurations (React/Next/Node)
- Can not use Leaflet with NextJS
- react.js does not update DOM after having changed state array
- Unable to set ref due to error "TS2339: Property 'X' does not exist on type 'Y' " inside a react component
- Unable to conditionally render component children: Cannot read property 'map' of undefined
- How to set up webpack for Pug, React, and ES6
- Certain parameters returns function error using reactjs
- How do I retrieve a component's props to test in Jest/Enzyme?
- State variables not getting rendered
- how to call function in parent component
- Loading a react dom
- How to block routes with '/' on create-react-app
- react-snap is not rendering html on the page
- setTimeout as callback on react setState?
- why getting 'WSGIRequest' object has no attribute 'data' error?