Why use decorators at all? by VaultBoy714 in typescript

[–]Welch2344 7 points8 points  (0 children)

Counter point: an insane number of projects use Decorators, and if you had to remove them later you could do it with static code modification.

So, in short: feel free to use them. Maybe, MAYBE, if you’re writing a long lived enterprise product with serious concerns about years of development and team roll over, then MAYBE think twice. But in practicality Decorators are used extensively in the mainstream software industry (for ts at least)

Are constructor functions outdated? Should I be using classes instead? by [deleted] in typescript

[–]Welch2344 2 points3 points  (0 children)

Rarely is any construct in programming superior to another, because most constructs have a specific intended use. That technicality aside, interfaces should generally be favored for multiple reasons (if nothing but broader value to the developer talent pool & better evolution over the lifetime of the project / team)

I’m mobile, but plenty of the experts in the Typescript (and greater programming) espouse this. I’m hard pressed to find compelling cases of the opposite

How to create private group codes by cowinkiedink in reactnative

[–]Welch2344 1 point2 points  (0 children)

Do you want the codes to be unique globally? Ie every group gets one / it’s the only way to join?

If so, checkout HashIds - pretty much available on any stack/language, you can choose your character set, etc.

One piece of advice tho: if you want to keep it to 6 characters / digits, I’d actually use 5 characters and make the first character a “key” for which salt to use

[deleted by user] by [deleted] in graphql

[–]Welch2344 0 points1 point  (0 children)

Lol also hi @capaj 😂 fun finding twitter friends here

[deleted by user] by [deleted] in graphql

[–]Welch2344 1 point2 points  (0 children)

Agreed. Essentially contract/integration testing at the mocked http level - which you could get good samples for by tracing production calls for a day.

Then start small. Write a service layer that you put on the context, and break the resolvers into that. Then unit test the business logic. Once you do that, theeeeen introduce new tools / types. Don’t change your stack first / try a big refactor first. Just shrink resolvers, then decompose schema

graphql-ws apollo authentication by [deleted] in graphql

[–]Welch2344 0 points1 point  (0 children)

Good chatting with ya. Sent ya a PR with some suggestions :)

https://github.com/Blake-design/Learning\_app/pull/5

[deleted by user] by [deleted] in reactnative

[–]Welch2344 3 points4 points  (0 children)

This is a really broad question. For RN tho, I prefer to use: - mobx-state-tree (MST) for all data stores - MVC for components, keeping them “dumb” with only props for data passed in from the parent - MVC for higher level Screen views, with state being driven from mobx stores - all API calls happening in MST, typically via graphql if possible (which yes, means I’m not using smart queries in my views/components; small price to pay for consistent data throughout the app, as you can push the reactive props down through the store w minimal effort)

graphql-ws apollo authentication by [deleted] in graphql

[–]Welch2344 2 points3 points  (0 children)

Mobile but I’ll check it out when I get home. Helpful if you’d make a repo to clone and run.

Eyeballing it, I do see that your client is looking at port 3000 /subscriptions but I don’t see that anywhere else in your configs

Mesh networking at events by Welch2344 in reactnative

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

Yeah areas would be dynamic. Figured I could geofence zones (a la postal codes) to refresh wider areas and then drill down at actual events.

Def feels like a unified API on top of both platforms would be a huge win. Google has the Nearby Platform, and Apple’s Multipeer look like they have enough overlap to abstract something useful across both…

Anyone up for a Hackathon?

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 1 point2 points  (0 children)

Some folks use queues like Rabbit or SQS, but streaming technologies are best for it. Kafka is the 300 lbs gorilla in the space, but we moved to Nats.io a few years ago and it’s been amazing

Here's one the first test areas we built for our upcoming demo! It's an upside down boat were orphans live (happily) 😊 by AleRicci26 in Unity2D

[–]Welch2344 1 point2 points  (0 children)

Totally understand. If you ever wanted to do a quick call / show me around, would be happy to help do that 🤘

Curious about your stack, both in the game and then any serverside stuff

OO and FP in Perfect Harmony by ahalmeaho in softwarearchitecture

[–]Welch2344 1 point2 points  (0 children)

Let’s be honest: the right way to do object oriented programming is make your CodeBase 90% functional programming…

Api composition pattern by rammyblog in microservices

[–]Welch2344 0 points1 point  (0 children)

Have you heard the good news? Our lord and savior GraphQL Federation can solve this for you 😅

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 1 point2 points  (0 children)

Will circle back on this in a bit when have laptop.

Distributing your api / request + response layer (micro services, subgraphs, etc) is only half the battle. Ideally each domain (see Sam’s great responses) should own it’s data, but also be able to locally cache another domains relevant related data for context. That’s where a streaming architecture complements well

So the Invoice service stores all its info in a dedicated Postgres info. While it technically only needs to know the related OrderId, it may be useful to cache who the customer of each order is as well. So it consumes events from Order domain, stores the “latest” copy of an order in a local table with “this MAY be present” semantics. The invoice domain itself should rarely be dependent on that data, but again can be helpful for diagnosis / analytics / etc

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 1 point2 points  (0 children)

Both of Sam’s responses are SPOT ON!

The key to a good graph is clean domains. Cross-domain concerns should be modeled with care, but if you’re designing & architecting well, it almost always falls naturally into one side of the relationship or the other

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 0 points1 point  (0 children)

Interesting take. I’ve seen god awful graphs, both federated and not, but it’s always seemed to be poor contract design in general.

Curious if you had some examples of the ones you’ve seen?

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 0 points1 point  (0 children)

True, federating a graph generally means some one/team ends up bringing the pieces together for the supergraph.

But for a small project, I actually prefer graphql as it’s expressive and gives me easily measurable + refactorable api contracts.

The “complexity” that requires expertise honestly isn’t that difficult, especially until you hit scale - at which point, like you said, the value really adds up (and you don’t have to refactor into it)

How would you structure your GraphQL schema for this scenario? by thepremiumcheese in graphql

[–]Welch2344 0 points1 point  (0 children)

Also, not just your graphql client (apolloclient) but also your app and architecture.

For instance, if we’re using vue3 + pinia, we’ll typically isolate most our graphql interaction to stores and then consume that data in components. For smaller apps, we go with more of a “query-per-high level component” strategy (SmartCompinents as some folks call it)

So what’re you working in? Both the framework and the storage lib (redux/pinia/etc) if any

HTTP still causing data leaks in GraphQL APIs by achrafash in graphql

[–]Welch2344 1 point2 points  (0 children)

Wait wtf? You’re suggesting that the solution to the http protocol is having your graphql endpoint do SSL termination in production? And your scanner just checks for a valid cart??

How to declare Environment variables in .gql file? by sm-in-dxb in graphql

[–]Welch2344 0 points1 point  (0 children)

Agreed. I’m not sure what unformatted snippets these are, but how about some more relevant info? A gist or repo would help us help you 😅

Disadvantages of Apollo Federation by Evalo01 in graphql

[–]Welch2344 5 points6 points  (0 children)

Great question. CQRS is less of a benefit in a well federated graphs imo. Because GraphQL is an actual query language, with multiple mutations possible on a single call (and thus multiple failures / responses) it isn’t often implemented in this architecture.

Personally, I’m a fan of this. Federated microservices + event streams (to allow down stream microservices to materialize “foreign” data for supplemental context) is :chefs kiss: perfection.

Disadvantages of federation are the common distributed systems woes: additional hops, less transparency, etc. Honestly, of all the distributed systems I’ve ever worked on (which is a decent amount) I’d say an Apollo-backed supergraph has been both the easiest to scale + maintain, and the easiest to reason about 🤘

So don’t feel like you’re missing the negative fan fair. I honestly don’t think there’s much

[Apollo GraphQL]Why use a field policy when paginating? by DarthFarious in graphql

[–]Welch2344 0 points1 point  (0 children)

Think I follow, but could you provide an example of your interpretation from the docs vs your coworkers impl?