Comments (5)
I think your updater function has to delete the entry in the list as well - or your mutation payload should include some way to re-query the list field such that you can update the store in the proper way when you call your mutation. Can you provide a more complete example (a repository with a repro would be good)? Then I'll happily try to assist you?
from relay-compiler-language-typescript.
oh nice, that's how i do it today-- the mutation payload includes the primary key removed & a foreign key which I can match with the name of every connection & list it can possibly belong to.
The tension is that the usage of a public API method (store.delete) can render a static type invalid, which kinda defeats the purpose of types. is there something we can do, or should it just be a rule to never use this method?
from relay-compiler-language-typescript.
Well first I'd test whether this is true when using Relay with flow (which I'm almost certain it is) - if that's the case then this issue should be posted in the Relay repo itself. We don't really control how the APIs work, we've only tried to replicate what is happening for Flow and port it to TypeScript.
from relay-compiler-language-typescript.
agreed! i'm just afraid it'll fall into a into the relay backlog black hole.
i'm mostly looking for a best practice here-- do you avoid calls to store.delete
or is it just assumed that your team always cleans up after a delete?
from relay-compiler-language-typescript.
the relay backlog black hole
π
As for the best practice, I canβt really offer any advice offhand, as our front-end apps only do the CRU part of CRUD atm, so would also have to play with an example app.
from relay-compiler-language-typescript.
Related Issues (20)
- Generated refetch definition with variables can not pass the validation of backend, such as github.com/vektah/gqlparser/v2
- Generate GraphQL fragment files for VSCode GraphQL Extension fragment autocompletion HOT 2
- Cannot read property 'createKeywordTypeNode' of undefined HOT 8
- Support for [email protected] HOT 8
- Migrate travis CI release process to GitHub actions HOT 3
- Unknown directive 'appendNode' HOT 1
- module esnext HOT 2
- Why is it not releasing HOT 7
- `require` substitution is not working HOT 6
- doc: explain why configuration with a single artifact directory is suggested
- Update to TS 4.4 and update types to support exactOptionalPropertyTypes HOT 1
- @stream argument naming by schema spec is: `initialCount` not `initial_count` HOT 1
- Invalid AST Node error with graphql@16 HOT 2
- Typescript 4.5 type generation is broken HOT 6
- Relay Compiler generates Typescript Synthax error HOT 3
- Error: Cannot find module 'relay-compiler-language-typescript' on 15.0
- Fragment Typematching
- Input Types generated as readonly HOT 1
- deprecate this package HOT 1
- Issue with import of the __generated__
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 relay-compiler-language-typescript.