I'm doing my first GraphQL project. For those of y...
# random
t
I'm doing my first GraphQL project. For those of you using AppSync are you using codegen to manage resolvers?
I got it working decently well with some really strong typing but took some fiddling, going to open source the whole project when I'm done
f
@Mike McCall helped me a lot with the
AppSyncApi
construct. I surely asked him a lot of noob questions back then 😅
m
We are using codegen to generate schema types. We try to use dynamo datasource and vtl resolvers as much as possible. Pipeline resolver are really nice too and you can leverage multiple datasources in a single pipeline. Conflict detection with appsync is also really cool!
t
Nice - sounds roughly the same. I've got everything going but now setting up subscriptions + websocket. Really scared of the amplify library so seeing if I can avoid it
m
Amplify is fine for the libraries and especially helpful with auth. I'd avoid the cli/IaC part of it.
t
I ended up getting it working without amplify, wasn't too crazy
m
Look forward to seeing it. I've used apollo with token auth but haven't dug too deep with using cognito auth with anything other than amplify. AWS pushes that shit hard.
s
agree 100% about the Amplify CLI. it’s not done too well IMO.. too hand-holdey to the point of obscuring what’s going on, and when something goes wrong & breaks, sometimes it’s incredibly difficult to fix it.
p
I really wanted Amplify to work but shifted away. Tried straight AppSync but eventually went to Apollo Server running on a lambda with https://typegraphql.com/. We use codegen to generate apollo client react hooks. Been pretty happy with the setup. I feel that Amplify will be awesome in like 3-4 years but right now just isn't there yet. Looking forward to seeing the project!
s
one of the big benefits of AppSync is that it seamlessly integrates with Cognito (if you’re using it, of course).
m
Agree, cognito integration with appsync is really nice.
AWS is hiring to improve the cognito experience.
s
that’s good to know. they need to add U2F/FIDO support
j
AppSync team is working on replacing VTL with JS runtime functions that you can edit from the console or define inline inside CDK.
s
VTL was the worst decision IMO
j
Yes, terrible to debug. But the performance is unmatched by Lambda resolvers? There must be some reason for the tradeoff. There’s always a tradeoff in life.
The Auth module in Amplify is the only useful thing. I avoid Amplify like the plague but unfortunately there is not a better solution for cognito auth client side.
s
I don't find Amplify to be that bad. The Auth and AppSync packages are useful and work great
t
I avoided amplify for auth too by using the underlying library that amplify uses
j
@thdxr are you saying there is a better package than @aws-amplify/auth that I can use instead? (For the sake of removing all traces of Amplify)
I have found several problems with AppSync Auth Link package, it has disastrous bugs with Subscriptions
So we are just using query polling instead of subscriptions.
We were thinking about releasing a library that simplified cognito auth on fe
I got subscriptions working outside of amplify as well
m
Can't wait to see the final example! I've had no issue with amplify Auth, Api, and subscriptions. I think the Amplify team (while understaffed and frustratingly slow for some issues) get some flak for service issues they can't control. I don't envy anybody on that team. I think they might be too ambitious and sacrifice quality for speed. That being said I do think the pros outweigh the cons. There's things to like about it outside of Auth and Api such as Hub, Analytics (event tracking), Hosting, etc.
t
Yeah for me I ultimately wanted to use URQL and using both that and Amplify felt like I'd be bringing in a lot of code and didn't want to verify if stuff was tree-shaken properly
m
That's awesome. In my opinion one of the most frustrating things is lack of alternatives or a least examples of them.
s
@Joe Kendal what kinds of disastrous bugs are there in AppSync subscriptions?
s
“disastrous”? it’s possible you’re being a bit sensationalist 😉 I haven’t had any issues other than expected timeouts, which I can catch & just reestablish the subscription.
j
I meant in the SDK not the API
AppSync is robust
s
I do wish they had a reconnect option for dropped websocket connections. I should open an issue
j
I am talking about the SDK having problems, not the service
This is my comment, it’s actually still quite relevant today https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/509#issuecomment-921742754
s
@Joe Kendal interesting, can’t say I’ve had that issue, thankfully.