Giter Club home page Giter Club logo

Comments (5)

kastermester avatar kastermester commented on July 24, 2024

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.

mattkrick avatar mattkrick commented on July 24, 2024

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.

kastermester avatar kastermester commented on July 24, 2024

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.

mattkrick avatar mattkrick commented on July 24, 2024

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.

alloy avatar alloy commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.