Awesome video, would love to see more, especially how to add resolvers for relationships. Maybe something like movies to directors? Keep up the great work Ben. Also, I think we need to start calling you The Exorcist...because there are "nodemons".
Thank you for this introduction. I really appreciate how you take the time to explain the context of what you are doing. It's refreshing to have someone put those smaller contextual pieces together for me. You are awesome!
if the great Ben Awad pronounces Node Monitor as Node Demon, it makes him more human and gives me confidence in completing his tutorials. Don't change, Ben
Awesome work! I knew your channel yesterday by config my vim setup and I love your content! I'm beginning with typescript because of you and I'm loving the benefits
There are also nice @ArgsType() and @Args decorators, using them you don't have to use an additional scope within your parameters and you can pick only some parameters you actually want to offer on your parameter definition and you also can set default values, example: @Args() { title = "default title", description = "default description", }: CreateEventArgs The parameter class (here named CreateEventArgs) is then decorated with @ArgsType() instead of @InputType()
Great video Ben! You should extend this tutorial, would be great to see how you implement the frontend on top of it with typescript and how you deploy. Interested to know your preferences and your take on those.
This is DOPE!! Thanks for this Ben 🙏 I've used Prisma in the past with GraphQL Yoga for the middle-wear and it was such a PITA for adding new fields and having to regenerate everything, this looks a lot more simplified! So, for me Ben, I'd like to know how to get this onto a sever somewhere, Zeit's now or something similar.
Very promising, but one problem I have with typeorm is, that it doesn't seem to give back any result if an update was successful or not. So how do you know if any row was affected by the update?
Hi Ben, can i seek your advise? Im toying around with TypeGraphql unions and came across following statement... Be aware that when the query/mutation return type (or field type) is a union, we have to return a specific instance of the object type class. Otherwise, graphql-js will not be able to detect the underlying GraphQL type correctly when we use plain JS objects. What does it mean? Im able to get the TypeGrahql unions working using Graphql playground so i'm not sure where im supposed to return a specific instance of the object type class? and also what I need to do to return a specific instance of the object type class? Thanks
I had a question about the dev dependencies. I noticed that in some of your previous projects that are structured very similarly to this one, you used @types/graphql. However, when I initialized the project that wasn't included, and it didn't seem to affect anything. Is there a reason for excluding/including @types/graphql? Are they included in type-graphql?
Bro!!! You always make awesome videos, i can’t stop checking ur chanel to make sure any new videos. By the way, would you like to teach online or have you had your own online course? I really want to purchase and learn from you
Suppose we have a table with 20 columns and 5 relationships. We would like to get 5 column and 1 relationship columns, with this example we took all of the columns data from table, return all of them. After than graphql picks and shows, is there a way to optimize the query ? Thanks for the video.
yes 1. you can read the info parameter in your resolver and determine the fields requested by the user, then optionally join tables 2. you can use dataloader to optionally load relationships ruclips.net/user/results?search_query=benawad+dataloader
Passing --exec tells nodemon to run a different program, instead of node. He's using ts-node as the executable since it's a TypeScript project. You can run and monitor other programs, such as python, ruby, etc. as well.
In Windows 10, when finished command 'npx create-graphql-api typescript-graphql-crud' and ran 'npm start', I got ''ts-node' is not recognized as an internal or external command, operable program or batch file.' What's wrong?
I spent hours today trying to make this work with arrays of objects. Typeorm has decorators for ManyToOne() fields and handling relations, but I couldn't for the life of me get the data saved to (and loaded from) the database. Have you tried it? Any tips?
hi Ben, thanks for the great tutorial..I have a question: is it possible to use optional parameter to query graphql? for example: with only Movie(title:string|null, length:string|null){} .. and will it return all rows if we dont pass any params : `{Movie{title length}}`..
@@bawad thank you for the answer. btw your WOW-build site has some bug, content exceeds the box .Please consider to limit the title as well (replace with ...)
Would love to see how you interstate subscriptions with this. And is there a better way to pass in resolvers into the buildSchema function. Example create a function that reads all the resolver files and return an array
Any way you could showcase how to do all those CRUD operations via inheritance, both typeorm and type-graphql wise? So we don't have to implement them for every entity, but simply inherit all basic resolvers?
Hey! Nice video as always! Could you do a video about robots.txt and sitemap? Would be super nice to see some of the best practices that you always deliver on those topics too! Keep up the good work!
I actually never create sitemaps, and rarely use robots.txt. I'll sometimes stick a route in robots.txt if I don't want it picked up by google but that's about it
This is great! Can you make a video about pushing a react app with graphql / typescript orm / postgres backend into production (ie. DigitalOcean, AWS, etc)? I also keep reading recommendations to run postgres as service to having to deal with backups, reliability, etc. Thoughts?
github.com/benawad/create-graphql-api#how-to-deploy-to-heroku ruclips.net/video/AdHwBKKQHZ4/видео.html I think they are great if you want to trade money for less dev time.
@@bawad I don't know how I missed that playlist, I had started a few of your other videos that were showing some testing but like mid way through when you already had multiple helper utils created and I felt overwhelmed jumping in, but this is definitely something I'm going to check out tonight and the video prior to it.
Hi Ben, nice to see more of these type-graphql videos. Quick question: I worked through the Type-GraphQL series and created a higher order resolver for the 'getAll' logic (ie. movies() ) I wonder if you could make a video addressing the where and orderBy selectors. I know Prisma auto-generates them for each entity, how might we do this with type-graphql? I found your response to stackoverflow.com/q/54192483/4411080 and that's essentially what I am looking to reproduce. That would be fantastic.
I'm actually not sure how to do it without introducing a lot of complexity. Because you would need to iterate over all the fields in the entity and I don't know a simple way to do that.
Im using the same but with mongoDb. Can you create a video about file upload ? lets say creating a user and uploading a profile picture in the same mutation. Thanks for your videos man.
Now I can get result only if I write the same name, saved in database. ex: if I search for "Car" , I should write it like it is, if I write "car" or just "ca" I get nothing !
@Ben Awad Yup, its amazing. I would definitely recommend it. Also since you are familiar with vim I would recommend using the minimal config that Oni has: github.com/onivim/oni/wiki/How-To:-Minimal-Oni-Configuration Here is how my Oni Vim looks like: imgur.com/F8i1kG4 imgur.com/gallery/lhxaB8U
Yes, please let's expand it bro.
Nice pace and to the point.
Greetings from Tanzania 🇹🇿
Awesome video, would love to see more, especially how to add resolvers for relationships. Maybe something like movies to directors? Keep up the great work Ben. Also, I think we need to start calling you The Exorcist...because there are "nodemons".
I can see the smile on the face when saying I just created this CLI tool. This is kind of proud of myself that I want in my life.
Ben! These videos are exactly what I wish I could tell people about modern JS/TS development. Thank you for spreading the word of sane JS developers.
I spent the whole weekend searching and reading how to use typescript with graphql. After I finished it, you uploaded the video! Sad but happy.
If you are already familiar with GraphQL, Apollo, and Typescript, this is a good tutorial. If you're not, then it's not.
Thank you for this introduction. I really appreciate how you take the time to explain the context of what you are doing. It's refreshing to have someone put those smaller contextual pieces together for me. You are awesome!
I just simply love your way of creating js project ben.
thanks
The way you pronounced "nodemon" :D
if the great Ben Awad pronounces Node Monitor as Node Demon, it makes him more human and gives me confidence in completing his tutorials. Don't change, Ben
their icon is a devil/demon tho, I think he might be right
Guess he's not human after all
@@PROFjavi Yeah.. that's messed up lol
😂 I lost my shit 😂 too funny
Great video man!
You really helped me to figure out how to make typegoose and type-graphql work together with this typeORM example.
Awesome work! I knew your channel yesterday by config my vim setup and I love your content! I'm beginning with typescript because of you and I'm loving the benefits
Good one, Ben! I really loved this video..
Could you please add more features to it? Like simple auth handling, validation and entity relationships?
sure
awesome video. We are using type-graphql in our company project now :)
If sqlite3 does not install properly, try installing version ^4.1.1 (Add "sqlite3": "^4.1.1" to dependencies of package.json.)
There are also nice @ArgsType() and @Args decorators, using them you don't have to use an additional scope within your parameters and you can pick only some parameters you actually want to offer on your parameter definition and you also can set default values, example:
@Args()
{
title = "default title",
description = "default description",
}: CreateEventArgs
The parameter class (here named CreateEventArgs) is then decorated with @ArgsType() instead of @InputType()
The one thing I don't like about that decorator is it's virtual, the graphql mutation wont take a object type but the individual args
i ve googled everywhere it s seems a lot of people having the same problem, yarn install throw an error related to sqlite3 (i am using wsl2)
Great video Ben! You should extend this tutorial, would be great to see how you implement the frontend on top of it with typescript and how you deploy. Interested to know your preferences and your take on those.
Checkout this for how to integrate with a react/next.js frontend ruclips.net/p/PLN3n1USn4xlkDk8vPVtgyGG3_1eXYPrW-
also just added github.com/benawad/create-graphql-api#how-to-deploy-to-heroku
Thank you so much! Do you have a simple sequel on how to connect with react?
This is DOPE!! Thanks for this Ben 🙏
I've used Prisma in the past with GraphQL Yoga for the middle-wear and it was such a PITA for adding new fields and having to regenerate everything, this looks a lot more simplified!
So, for me Ben, I'd like to know how to get this onto a sever somewhere, Zeit's now or something similar.
sure thing
Added a section on how to deploy: github.com/benawad/create-graphql-api#how-to-deploy-to-heroku
wheeeeeeee! Thank @@bawad I'll have a play now!!
Do you think graphql would work with unity? I am confused how we'll be able to send the query format,
Can you make an updated version of this video? I wanna know what you changed after using this stack for a year.
Well explained. Thank you for the effort!
great stuff. yeah we want some expanded functionality for sure. thanks much and rock on.
Such a useful tutorial ben
Thank you!
Loved it! Just perfect workflow. Similar to Nest.js
Would love to see a video on graphql authentication!
ruclips.net/video/25GS0MLT8JU/видео.html
Thank you. It’s looking pretty cool. Is it possible to make a nested mutation? For example, if movies have an array of some tags, how to mutate them
Very promising, but one problem I have with typeorm is, that it doesn't seem to give back any result if an update was successful or not. So how do you know if any row was affected by the update?
Does it not return the rows affected?
@@bawad No, it returns just empty arrays.
I think the query builder might give you the rows affected typeorm.io/#/update-query-builder
what do you think about prisma? I've been trying it out recently and I think it's pretty cool. Great vid as always
Is it exclusive for graphql or can I use with just express?
I like TypeORM better than Prisma v1, but I'm interested to give Prisma v2 a try when's it out and reevaluate
Please make more videos on Type script + GraphQL
You're in luck, I make a ton of typescript and GraphQL videos
Hi Ben, can i seek your advise? Im toying around with TypeGraphql unions and came across following statement... Be aware that when the query/mutation return type (or field type) is a union, we have to return a specific instance of the object type class. Otherwise, graphql-js will not be able to detect the underlying GraphQL type correctly when we use plain JS objects.
What does it mean? Im able to get the TypeGrahql unions working using Graphql playground so i'm not sure where im supposed to return a specific instance of the object type class? and also what I need to do to return a specific instance of the object type class? Thanks
I would actually look at the resolveType option instead
@@bawad Noted Ben. Thanks
I had a question about the dev dependencies. I noticed that in some of your previous projects that are structured very similarly to this one, you used @types/graphql. However, when I initialized the project that wasn't included, and it didn't seem to affect anything. Is there a reason for excluding/including @types/graphql? Are they included in type-graphql?
@types/graphql is now included with the graphql package
Hi Ben :) Congratulations, you're really insightful.
Quick question though, is it possible to use ts-node-dev instead of Nodemon ?
yes
Hey Ben! What's you're setup to record these videos (screen casting/recording, green screen, camera, etc)?
audio technica 2100 + canon eos sl2 + green screen + obs
I assume you handle db errors with standard try-catch?
Bro!!! You always make awesome videos, i can’t stop checking ur chanel to make sure any new videos. By the way, would you like to teach online or have you had your own online course? I really want to purchase and learn from you
No plans to do paid courses right now, focusing on free youtube courses and tuts
Excellent tutorial, helped me a lot!
Thanks for sharing your knowledge and time!
Success in your projects!
Suppose we have a table with 20 columns and 5 relationships. We would like to get 5 column and 1 relationship columns, with this example we took all of the columns data from table, return all of them. After than graphql picks and shows, is there a way to optimize the query ? Thanks for the video.
yes
1. you can read the info parameter in your resolver and determine the fields requested by the user, then optionally join tables
2. you can use dataloader to optionally load relationships ruclips.net/user/results?search_query=benawad+dataloader
why do you write script start exactly with --exec... It works for me just "nodemon index". Thank you
Passing --exec tells nodemon to run a different program, instead of node. He's using ts-node as the executable since it's a TypeScript project. You can run and monitor other programs, such as python, ruby, etc. as well.
"message": "Connection \"default\" was not found.",
why ?
In Windows 10, when finished command 'npx create-graphql-api typescript-graphql-crud' and ran 'npm start', I got ''ts-node' is not recognized as an internal or external command,
operable program or batch file.' What's wrong?
You need to install ts-node. Do an `npm install` on the project if it still doesn't work try installing ts-node globally by running `npm i -g ts-node`
Basically, looks like in new ApolloServer the formatArgumentValidationError is not needed anymore as
Thx for the video learned a lot, do you know how to do mutations for entities with ManytoOne relations?
I spent hours today trying to make this work with arrays of objects. Typeorm has decorators for ManyToOne() fields and handling relations, but I couldn't for the life of me get the data saved to (and loaded from) the database. Have you tried it? Any tips?
ruclips.net/video/8kZ7W-bI5qQ/видео.html
I think I'll be doing some more relationship videos soon
hi Ben, thanks for the great tutorial..I have a question: is it possible to use optional parameter to query graphql? for example: with only Movie(title:string|null, length:string|null){} .. and will it return all rows if we dont pass any params : `{Movie{title length}}`..
! makes it non-null, so you can do title: String
@@bawad thank you for the answer. btw your WOW-build site has some bug, content exceeds the box .Please consider to limit the title as well (replace with ...)
thanks, do you have a link to the build that was overflowing?
@@bawad this build filthy-casual-enhancement-shaman-talent-tree on the homepage
thanks
Great video Ben! Would you please do a follow up video on connecting this with React, TypeScript and @apollo/react-hooks?
checkout how I do it in this video ruclips.net/video/25GS0MLT8JU/видео.html
it's using different queries/mutations but the setup is the same
@@bawad Awesome, thank you!
Would love to see how you interstate subscriptions with this.
And is there a better way to pass in resolvers into the buildSchema function. Example create a function that reads all the resolver files and return an array
I might do a subscription template.
typegraphql.ml/docs/bootstrap.html
Any way you could showcase how to do all those CRUD operations via inheritance, both typeorm and type-graphql wise? So we don't have to implement them for every entity, but simply inherit all basic resolvers?
And maybe also how to automatically get "edges" and "nodes" fields (connections?). I never understood how e.g. postgraphile creates those...
I tried this once, but it was a pretty fragile abstraction and decided it wasn't worth it
When wrapping app.listen in a function like that, how do we export the app variable to do endpoint testing with like supertest and jest?
if you want to do that, I would do a named function and export it
Very good, thank you!
Any Plans to expand this Ben?
Hey! Nice video as always! Could you do a video about robots.txt and sitemap? Would be super nice to see some of the best practices that you always deliver on those topics too! Keep up the good work!
I actually never create sitemaps, and rarely use robots.txt.
I'll sometimes stick a route in robots.txt if I don't want it picked up by google but that's about it
This is great! Can you make a video about pushing a react app with graphql / typescript orm / postgres backend into production (ie. DigitalOcean, AWS, etc)?
I also keep reading recommendations to run postgres as service to having to deal with backups, reliability, etc. Thoughts?
github.com/benawad/create-graphql-api#how-to-deploy-to-heroku
ruclips.net/video/AdHwBKKQHZ4/видео.html
I think they are great if you want to trade money for less dev time.
Any chance of doing unit testing for these using jest? Possibly with start to finish of any test util functions required?
ruclips.net/video/fxYcbw56mbk/видео.html
ruclips.net/video/zR8jKR9hnFA/видео.html
@@bawad I don't know how I missed that playlist, I had started a few of your other videos that were showing some testing but like mid way through when you already had multiple helper utils created and I felt overwhelmed jumping in, but this is definitely something I'm going to check out tonight and the video prior to it.
Can you show how it integrates with class-validator, error handling and authorization in general?
checkout ruclips.net/p/PLN3n1USn4xlma1bBu3Tloe4NyYn9Ko8Gs
Hi Ben, nice to see more of these type-graphql videos. Quick question: I worked through the Type-GraphQL series and created a higher order resolver for the 'getAll' logic (ie. movies() ) I wonder if you could make a video addressing the where and orderBy selectors. I know Prisma auto-generates them for each entity, how might we do this with type-graphql? I found your response to stackoverflow.com/q/54192483/4411080 and that's essentially what I am looking to reproduce. That would be fantastic.
I'm actually not sure how to do it without introducing a lot of complexity. Because you would need to iterate over all the fields in the entity and I don't know a simple way to do that.
Great tutorial. Thank you!
Are you using Type-GraphQL for Saffron?
Yeah
@ben awad, please can you do a react frontend for this? Thanks
ruclips.net/p/PLN3n1USn4xlkDk8vPVtgyGG3_1eXYPrW-
Good stuff bro, I was wondering if you could do a similar video but hook it up to MongoDB and explain how the database gets updated under the hood?
I don't know mongo that well
Im using the same but with mongoDb. Can you create a video about file upload ? lets say creating a user and uploading a profile picture in the same mutation. Thanks for your videos man.
ruclips.net/video/s35EmAn9Zl8/видео.html
Cool video liked it!
awesome!
no-demon! I've been saying it wrong all along! LOL!
Awesome
Thanks, to Make this tutorial more complet you can add movies subscription
Yeah
Bro, can u create one video with graphical view of button combinations that u pressing, please?)
benawad.com/vim
ruclips.net/video/R2pBWDnfJY8/видео.html
@@bawad Oh, bro, thx!)
Can someone help me with how to do relations in resolvers and entities? Can't quite get it yet.
ruclips.net/video/8kZ7W-bI5qQ/видео.html
nice!
what's up with the thumbnail? I noticed the last four/five videos you made yourself bigger and bigger. You feeling yourself more and more I see? XD
😜
Do someone knows how to create a live search bar with GraphQL using regex ?
like the search in youtube or google
What part of creating that are you unsure about?
@@bawad The GraphQL Query structure
Now I can get result only if I write the same name, saved in database. ex: if I search for "Car" , I should write it like it is, if I write "car" or just "ca" I get nothing !
how are you doing the db query? You might want to try using the ilike operator
That's node + mon = nodemon :p
Hey Ben, have you ever tried using Oni vim?
Its a GUI neovim and it seems pretty good
github.com/onivim/oni
I haven't, do you like it?
@Ben Awad Yup, its amazing. I would definitely recommend it. Also since you are familiar with vim I would recommend using the minimal config that Oni has:
github.com/onivim/oni/wiki/How-To:-Minimal-Oni-Configuration
Here is how my Oni Vim looks like:
imgur.com/F8i1kG4
imgur.com/gallery/lhxaB8U
cool, I'll have to give it a spin sometime
ts-node-dev is much better and faster than ts-node + nodemon
twitter.com/benawad/status/1211700652549779456
Using typescript with graphql is not a good idea. Graphql is already strongly typed.
I actually have the opposite opinion. Typescript is great with GraphQL *because* they are both strongly typed and you can share the types