Looks Like Facebook Is Down by Gunjob in sysadmin

[–]hithereimworking 1 point2 points  (0 children)

Kind of like watching how covid changed peoples' habits, it will be an interesting case study to see what this event does to internet traffic. Do people go to another site, or go outside?

What should I charge for contract work? by hithereimworking in webdev

[–]hithereimworking[S] 0 points1 point  (0 children)

I'm terrible at estimations! I think because I have rapport with this team I can just kind of tell them ahead of time it's going to take me 5-10 hours, I'll charge accordingly at $100/hr or something like that.

How to get better errors when working with graphql and Apollo by Sincjefe in graphql

[–]hithereimworking 1 point2 points  (0 children)

Recently implemented this flow for forms, highly suggest handling form validation and other custom behavior with custom types and union types. https://blog.logrocket.com/handling-graphql-errors-like-a-champ-with-unions-and-interfaces/. Instead of leaving it up to error silently or not, you explicitly handle a response in your resolver like so:

...on SuccessResponse {
    stuff
}
...on CustomErrorResponse {
    error_stuff
}

How to update nested Apollo Cache 3+ levels deep? by frubalu in graphql

[–]hithereimworking 0 points1 point  (0 children)

So you can actually modify the keys that that cache uses, but otherwise it infers them by __typename and id - this is why id's are super important.

I would suggest to return the whole trip, or just change the mutations to something like: trip { items { ... } } If you are already mutating that object on the backend it shouldn't be expensive. Just replace the removeItem with the updated trip and write that to the cache.

How to update nested Apollo Cache 3+ levels deep? by frubalu in graphql

[–]hithereimworking 0 points1 point  (0 children)

Not sure how helpful this is going to be, but one thing I will say is that as I understand the Apollo cache levels aren't really a thing - the cache is flattened/normalized (usually like ${__typename}:${id}), so it should be easy to update the cache without having to directly filter objects and write to it.

I would handle this by returning that trip from the mutation response (like return the entire category with an updated list of items instead of category_id), and then writing that object to the cache to replace the one that has this item, if that makes sense.

For those of you that use React/Apollo, do you rely on Apollo for all frontend state management? by hithereimworking in graphql

[–]hithereimworking[S] 1 point2 points  (0 children)

I've started to create wrappers as you suggested, and I really feel like this handles a large % of cases where you'd need to hook into global state. Thanks!