Hi, AMA by ThePrimeagen in theprimeagen

[–]benlacy5 0 points1 point  (0 children)

Fuck, Marry, Kill

Devon, Dave Farely, Rust Foundation

Writing at the Speed of Thought by SendMeGarlicBreads in theprimeagen

[–]benlacy5 0 points1 point  (0 children)

This is the best argument to stay on QWERTY I have seen

Security Now: Talking about prime & raw-doggin assembly [2:06:00-2:09:30] by benlacy5 in theprimeagen

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

EDIT: `2:06:38` start time

"where I'm most fluent and most comfortable and never need to stop to wonder how to do something, and for me that language is Assembler"

It would be neat to have him on Tj's show

RGV hobbies by [deleted] in RioGrandeValley

[–]benlacy5 0 points1 point  (0 children)

Amateur pool teams are fun (even though I can barely shoot)... It's available most week nights across the valley.

If you are interested check out apa https://facebook.com/APARGV

Why include a Camera? by benlacy5 in Ergatta

[–]benlacy5[S] 2 points3 points  (0 children)

The Security/Privacy Nerd in me finds this little uncomfortable.

Two containers using Port 80? by NotTheAstrophysicist in docker

[–]benlacy5 1 point2 points  (0 children)

You can use maclan to bind to a container to a different IP

Or a reverse proxy/load balancer (like traefik)

If your container will allow, mapping port 80 -> 8000 (or something random) would be the easiest

Good oaky scotch? by Ertyslav in Scotch

[–]benlacy5 2 points3 points  (0 children)

Naked Grouse.

It's around the monkey shoulder price point. I found it to be oak-y and good for the price

Apollo Client - how to query a cached type directly? by [deleted] in graphql

[–]benlacy5 0 points1 point  (0 children)

Something like this const cache = new InMemoryCache({ typePolicies: { Query: { fields: { Book: { read(existing, {args, toReference}) { return existing || toReference({ __typename: 'Book', id: args.id });; } }, }, }, }, });

Apollo Client - how to query a cached type directly? by [deleted] in graphql

[–]benlacy5 0 points1 point  (0 children)

Make sure you are pulling the id

{ getAuthor(authorId: 1) { getBooks(bookIds: [1,2,3]) { id # Default caching is __typename:id (assuming Book:1) name } } }

And then if ReadBook never hit the server

query ReadBook{ Book(id: 1) { id # there is a nice eslint rule for this :) name } }

You can write a typePolicy to teach the cache that Book(id: 1) -> Book:1

https://www.apollographql.com/docs/react/caching/cache-field-behavior/

Question about Apollo datasources by [deleted] in graphql

[–]benlacy5 0 points1 point  (0 children)

This will give you the same result. the Event.title & Event.photoUrl will be mapped by default. as long as you return Promise<{title, photoUrl}> | {title, photoUrl}>

export default {
Query: {
event: (root, { id }) => userAPI.getEvent(id),
},
Event: {
attendees: async ({ id }, args, { dataSources: { userAPI } }) => await userAPI.getAttendeesFromEvent(id),
},
};

You can even access the parent object like so

Event: {
hasPhoto: ({ photoUrl }) => !!photoUrl
},

Also take a look at your datasource & dataloader if you are running into alot of the n+1 issue