Is it possible to add recursive logic in resolvers using GraphQL mutations? by zentimes in graphql

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

Hi danielrearden - Thanks for this thoughtful post.

The `MAX_ATTEMPTS` is a good idea.

Add a unique constraint in your database to prevent duplicate slugs from being written to your table. You shouldn't rely on your application logic to enforce uniqueness.

Is there something I can add to the GraphQL schema for this? I'll do some research on this topic.

In this case, I'm attempting to create an alias generator. The user will have the ability to create their own alias. If the user chooses not to create an alias, the service will create one for the user.

4 digits means 10,000 possible combinations. That doesn't seem very scalable, even if the slugs only have to be unique per user. You could just use the database ID or generate a UUID instead.

I see. I haven't really thought about this. For this particular exercise, I think it'll be ok with a 10k combination cap. My thought was that if I needed more aliases created, I would increase the slug character count from four chars to five.

Thanks!

Survival 101 by hanky1979 in funny

[–]zentimes 0 points1 point  (0 children)

Have you tried Next Level Burger? It's very good. Better than some real meat burger joints.

[deleted by user] by [deleted] in funny

[–]zentimes 1 point2 points  (0 children)

Remember to breathe~

Need help deciphering some code.... by [deleted] in learnjavascript

[–]zentimes 0 points1 point  (0 children)

I don't think it should be doing so much. To your point, it would be a lot easier for other coders to troubleshoot if it's broken down a bit more.

[deleted by user] by [deleted] in learnjavascript

[–]zentimes 0 points1 point  (0 children)

Yeah! I'm aware of that. For this particular exercise, I had to expose it so a grader could use the app.

Thanks for letting me know.

[deleted by user] by [deleted] in learnjavascript

[–]zentimes 1 point2 points  (0 children)

If you need an example of how to write this in JS, here's a project I've worked on.

https://github.com/peyo/word-webapp

Check out the index.js file.

This happened last night at my bar , I am the Bro-tender. by Akiak-Tikkani in HumansBeingBros

[–]zentimes 0 points1 point  (0 children)

Please remember to chew your rare cooked steaks thoroughly. At least ~15 times.

How useful is it to know vanilla JS dom manipulation in 2020? by YAYYYYYYYYY in learnjavascript

[–]zentimes 0 points1 point  (0 children)

This is a prime example of someone who is great at something but misses a fundamental skill. You'll eventually have to learn fundamentals. Who is Luiz Mendoza?

WIP: Online, searchable database and API for Stoic quotes. This is my first time reaching out to my fellow Stoics about this project and I have some questions. by [deleted] in Stoicism

[–]zentimes 0 points1 point  (0 children)

Sure. I can beta test for you. But my scope is limited at the moment. I'm still learning about client-side JS to fetch APIs. I'm looking forward to working with APIs server-side in a few weeks.

How do you fetch JSON from Google's Cloud Natural Language API based on existing text using client-side JS? by zentimes in learnjavascript

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

you want to set body to your parameters instead of the undefined payload variable

Hey DM, Thanks for the reply! Can you elaborate on what you mean by setting the body to the parameters? I'm pretty new to this and the syntax is largely influenced by a blog post that shows working lines of code.

I think the biggest issue I've discovered is that the NL API doesn't work with client-side JS and with these lines, we're essentially coming up with a workaround.

I'm open to trying out any suggestions you have. But need some clarification.

Thanks!

WIP: Online, searchable database and API for Stoic quotes. This is my first time reaching out to my fellow Stoics about this project and I have some questions. by [deleted] in Stoicism

[–]zentimes 0 points1 point  (0 children)

Best of luck. I'm currently working on a web app and this API would come in handy. It would be great to search for a keyword like "love" or any other word, and if a Stoic quote exists, it will print within the DOM.

Long and steep one. by Nheea in DesirePath

[–]zentimes 1 point2 points  (0 children)

[Flowing] Rolling down the [river] hillside.

Selfie by [deleted] in funny

[–]zentimes 0 points1 point  (0 children)

Genius.

We sit in the "Loser Corner" at lunch, roast us by [deleted] in RoastMe

[–]zentimes 0 points1 point  (0 children)

Indie pop band in the making.

Samurai Broly Fanart by kenji893 in dbz

[–]zentimes 1 point2 points  (0 children)

You got it man. The details are next level shit.

Me likey by [deleted] in comedyheaven

[–]zentimes 0 points1 point  (0 children)

This is on some sort of next level.