Best way to create GraphQL API ?? | NestJS GraphQL Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 246

  • @mariusespejo
    @mariusespejo  3 ปีที่แล้ว +11

    00:00​ - Intro
    00:47​ - What we'll build
    02:23​ - PART I: Generate project
    04:23​ - Generate Pets module
    05:27​ - Code first vs Schema first
    07:29​ - GraphQL Module import
    07:47​ - Creating Pet Object Type
    11:24​ - Writing our first query within the resolver
    14:18​ - Testing our new query
    15:32​ - PART II: Database Integration
    18:00​ - Pet database entity
    20:02​ - Update PetsService to use database
    22:13​ - createPet implementation
    24:41​ - Writing an Input Type
    26:46​ - PART III: Mutations
    30:35​ - Validation setup
    34:21​ - Implement findOne query
    37:28​ - How to auto generate all the boilerplate
    40:13​ - Owner database entity
    40:59​ - Implementing Pet/Owner relationship
    44:28​ - Ability to add owner info along pet query
    47:46​ - Implementing query to get pet owner
    52:19​ - Conclusion
    52:58​ - Outro

  • @abolfazljalildoost766
    @abolfazljalildoost766 ปีที่แล้ว +3

    Everything you need to know about Nest exists in your channel. Amazing tutorials. Thank you

  • @MultiShokk69
    @MultiShokk69 2 ปีที่แล้ว +2

    Nice video like always, thank you !
    For the guys who have this error with findOne(id), it doesn't work anymore, it's findOne({where: {id:id}}

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      Thanks! Yeah that syntax changed slightly in typeorm 0.3

  • @jimknopf5558
    @jimknopf5558 ปีที่แล้ว

    I was a bit put off by the length of the video because I really just needed to brush up a bit. But I'm glad I watched it in its entirety. Thanks a lot, very nicely explained, helped me a lot!

  • @PauloTheDev
    @PauloTheDev 3 ปีที่แล้ว +5

    Your walkthroughs are gold, thank you sir!

  • @Holdino_
    @Holdino_ 3 ปีที่แล้ว +4

    Awesome as always! Loving the Nextjs / TypeOrm content

  • @Thorax232
    @Thorax232 2 ปีที่แล้ว

    I'm coming into NestJS new for a GraphQL solution, this is a great quickie to get things off the ground, appreciate it.

  • @fish1r1
    @fish1r1 ปีที่แล้ว

    I'm glad it's comprehensive but on point with explanations.

  • @kawthooleidevelopers
    @kawthooleidevelopers 2 ปีที่แล้ว

    Thanks, Bro. Your tutorial has made my life easier trying to figure out how to implement GraphQL with NestJs.

  • @keyurpatel1980
    @keyurpatel1980 ปีที่แล้ว +1

    Hello Marius, Thank you very much for this great tutorial. The flow of the tutorial is so nice and easy to follow as well the way you introduce advanced scenario is really great. I admit this is the number one tutorial I have ever seen on TH-cam.

    • @mariusespejo
      @mariusespejo  ปีที่แล้ว

      Thank you for your feedback, glad you found it helpful 🙂

  • @luiseduardo2567
    @luiseduardo2567 ปีที่แล้ว

    Good content. Simple and straightforward but extremely accurate and informative. It's hard to find a guide to anything in programming without a lot of dodging these days.

  • @OmnispectiveHub
    @OmnispectiveHub ปีที่แล้ว

    Just started watching the video and you already cleared up some things for me in my mind. Can't wait to check out more of your content.

  • @a.anvarbekov
    @a.anvarbekov ปีที่แล้ว

    Just finished. Loved your way of teaching, thanks brother

  • @ДмитроОнуфрієнко-м1з
    @ДмитроОнуфрієнко-м1з ปีที่แล้ว

    Great tutorial.
    Pretty simple and chilly explenation of basics.

  • @aghileslounis
    @aghileslounis 2 ปีที่แล้ว +4

    calm and collected, very good course ! looking forward for a more detailed and complete Nestjs course (paid why not) :) great job

    • @SpyingCraft
      @SpyingCraft 2 ปีที่แล้ว

      lols ap karwalein paid :)

  • @rajgohil8610
    @rajgohil8610 2 ปีที่แล้ว

    i mean seriously brother you are a god level teacher everything you have explained is so straight forward... you explain every thing you are doing thank so much for this wonderful concept thank you so much , I hope you got many views and you grow faster thank you so much brother...

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      Thank you Raj 🙏 appreciate your support!!

  • @sandipbasnet5557
    @sandipbasnet5557 3 ปีที่แล้ว +4

    I just want to say, thank you so mush for curating this amazing video.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +1

      no problem glad you found it useful!

  • @rickycoates3003
    @rickycoates3003 2 ปีที่แล้ว

    That pretty much all I ever wanted and needed to get start modifying pre-made projects using this amazing tech
    Thank you so much

  • @devcotv
    @devcotv ปีที่แล้ว

    This is a great tutorial. Thank you so much for sharing it. It's really helpful for me, and I think it's also suitable for other people who are looking for more details on working with GraphQL + Nestjs. Thank you

  • @Ari6n
    @Ari6n 2 ปีที่แล้ว

    Marius, thank you for the video - it was very helpful!
    I'm just started learning NestJS, TypeScript and GraphQL concepts. And there you explained a lot.
    So your video worked as amazing starter boost for me :)

  • @ademmohammed3939
    @ademmohammed3939 2 ปีที่แล้ว +3

    Thankyou for the tutorial. Very helpful. I was wondering if you could share the repository of the code in the video, it would be much more impactful.

  • @ViciuSRO
    @ViciuSRO 4 หลายเดือนก่อน

    amazing, still relevant in 2024! thanks mate!

    • @mariusespejo
      @mariusespejo  4 หลายเดือนก่อน

      Thanks! Good to know, I was thinking of maybe doing a refresh of this with current versions

    • @ViciuSRO
      @ViciuSRO 4 หลายเดือนก่อน

      @@mariusespejo will be amazing to include DataLoader topic as well

  • @muratasarslan2359
    @muratasarslan2359 3 ปีที่แล้ว +1

    Very useful, easy to follow along. Thanks. Looking forward to see more graphql content 😀

  • @hasst9261
    @hasst9261 6 หลายเดือนก่อน

    Your channel is a godsend

  • @3rg1s
    @3rg1s 3 ปีที่แล้ว +3

    Hello Marius, thanks for the great tutorials. What do you use to create that sparkling effect when typing on your terminal?

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +2

      thanks! it’s the hyper terminal and it’s just one of the default plugins for it

  • @teknolovedigital
    @teknolovedigital ปีที่แล้ว

    You are the master of nestjs on youtube

    • @mariusespejo
      @mariusespejo  ปีที่แล้ว +1

      Nah, lots of great content creators out there haha but I do hope that people are subscribing based on my teaching style

  • @happyrealtor2024
    @happyrealtor2024 3 ปีที่แล้ว +1

    This tutorial is AWESOME !!! Thank you Marius.

  • @iPururin
    @iPururin 2 ปีที่แล้ว

    This is awesome content! Looking forward for more NestJS!!

  • @chambaderaphael8946
    @chambaderaphael8946 ปีที่แล้ว

    Perfect tutorial👍

  • @trung-tinpham2437
    @trung-tinpham2437 3 ปีที่แล้ว

    Awesome man! There are lots of information. Thanks a lot ❤️

  • @TheWalrus_45
    @TheWalrus_45 2 ปีที่แล้ว

    Whats up Marius! There has been big changes in NestJS GraphQL. The GraphQL library is now a plugin which means you can use Mercurius instead of Apollo. What makes this really exciting is that just a few hours ago an update was merged that allows Mercurius subscriptions with federation! Something that is not possible with Apollo.

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      Interesting thanks for the heads up, I might make a newer follow up to this video, it’s getting a bit dated lol

  • @goldy8963
    @goldy8963 2 ปีที่แล้ว

    Good job ! It was very helpful ! Keep creating great content like this one

  • @anton_ivanov52
    @anton_ivanov52 2 ปีที่แล้ว

    offtop question: @Marius what MacOs Terminal plugins or app do you use? looks awesome!

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      In my older videos (probably like this one) I messed around with hyper, which is a hackable terminal. Nowadays I mostly keep it simple with iTerm2 and oh-my-zsh with auto complete and syntax highlighting

  • @tahsinxeelani3107
    @tahsinxeelani3107 2 ปีที่แล้ว

    your subscribers should be wayyy up man.

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      Thanks 😄 still growing! Just takes time.. hope you’re one of them!!

  • @Martijncvv
    @Martijncvv ปีที่แล้ว

    Thanks sir! Would happily pay for some more advanced NestJS courses

    • @mariusespejo
      @mariusespejo  ปีที่แล้ว

      Thanks for the thought! I have been thinking about putting something together

  • @emreaka3965
    @emreaka3965 ปีที่แล้ว +1

    Do we need circular dependencies? Isn't it something we should avoid? I mean if you also would like to query owners with their pets, we have to have a circular dependency. Owner service needs pet service and pet service needs owner service, right?

    • @mariusespejo
      @mariusespejo  ปีที่แล้ว

      If you can avoid it you probably should, but like you mention there are cases where you can’t avoid it when the relationships of your data are naturally circular. There is a documented way to resolve this in Nest, see:
      docs.nestjs.com/fundamentals/circular-dependency

  • @emiremark2889
    @emiremark2889 3 หลายเดือนก่อน

    really good tutorial. do you have a sample for pagination ?

    • @mariusespejo
      @mariusespejo  3 หลายเดือนก่อน

      Thanks! I don’t think so I do but I recommend first understanding the different approaches outlined here: graphql.org/learn/pagination/
      Then depending on the approach you take, setting up the inputs to map to whatever your database requires, e.g. take/offset

  • @dougkfarrell
    @dougkfarrell 2 ปีที่แล้ว

    Really helpful, thanks for doing this!

  • @michaldoubek4686
    @michaldoubek4686 3 ปีที่แล้ว

    Thank you, it inspired me, how to refactor one of my apps.

  • @YOUdudex
    @YOUdudex 3 ปีที่แล้ว

    Awesome tutorial subscribed and shared with friends, thanks!

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      Thank you! Appreciate the support

  • @oldo-nicho
    @oldo-nicho 2 ปีที่แล้ว

    Epic video, thanks so much!
    Is there any way to use the entity model when creating the input type? Sort of like in Typescript you can do Pick, or Omit? There seems to be a doubling up of declaring the fields in the entity and input type that is not so DRY.

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      Yup there’s support for something like that, take a look at mapped types: docs.nestjs.com/graphql/mapped-types
      But also something to think about, while there is some duplication, the input type and the entity have somewhat different concerns, e.g. the input types can be utilized for validation

    • @oldo-nicho
      @oldo-nicho 2 ปีที่แล้ว

      @@mariusespejo thanks! Will take a look

  • @basitwahid3452
    @basitwahid3452 2 ปีที่แล้ว

    Great video Bro! Thanks a lot, it was all explained very well and easy way you can't imagine how much its good for me thanks

  • @jhoannydiaz
    @jhoannydiaz 3 ปีที่แล้ว

    Hi Marius, great video! Does it still need 'graphql-tool' as dependency? I don't see it in the list of dependencies anymore in the official documentation of NestJs.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +1

      That dependency doesn’t ring a bell to me and perhaps I am misremembering but I don’t remember mentioning that in my video here. Anyways I would assume that the official docs is the source of truth, if it’s not mentioned there then I would assume no

  • @wiseman9960
    @wiseman9960 ปีที่แล้ว

    @Marius what is your Vscode theme? I like it

  • @baohoang5421
    @baohoang5421 2 ปีที่แล้ว

    Pretty good! Keep it going sir!

  • @kfchotdog
    @kfchotdog 3 ปีที่แล้ว +1

    Love your videos, keep it up m8.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +1

      thanks man, appreciate it

  • @zackOverflow
    @zackOverflow ปีที่แล้ว

    It's Awesome 👍

  •  2 ปีที่แล้ว

    Excelent tutorial

  • @djonkoful
    @djonkoful 3 ปีที่แล้ว

    thanks for this journey. the content was useful and great for me

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      I’m glad you think so, thanks for stopping by to comment 🙏

  • @elco7956
    @elco7956 ปีที่แล้ว

    Great video

  • @jonathasrr
    @jonathasrr 2 ปีที่แล้ว

    Very good, thanks!

  • @artemivanychev2074
    @artemivanychev2074 2 ปีที่แล้ว

    Nice video! Thx!

  • @роматарасов-о8л
    @роматарасов-о8л 3 ปีที่แล้ว

    Гигант мысли,
    In this video i find answers on all questions

  • @CJMFitnessJourney
    @CJMFitnessJourney 3 ปีที่แล้ว

    Can you please create video how someone can protect graphql query based on my certain user role/permission? . Like a user with a role can only query but not create. It was very simple to do with REST api using Guards.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      It should be mostly the same in graphql, couldn’t you simply add guards to your resolver methods?

    • @CJMFitnessJourney
      @CJMFitnessJourney 3 ปีที่แล้ว

      @@mariusespejo I tried, but I wasn't able to get custom metadata from reflector. It was being undefined. But anyway I got it another way by creating global middleware and conditional checking req.body.operationName :)

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      Could maybe be an issue with how you’re registering your guard? The reflector usually should be injected automatically, but anyways I haven’t tried with graphql will give it a shot sometime

  • @rajatgupta6409
    @rajatgupta6409 2 ปีที่แล้ว

    @Marius, Thanks for the great content. I have a query regarding Microservice Architecture with GraphQL API Gateway. The question is. How would i communication from GraphQL API Gateway to my service (HTTP or Message Queue) and how Service 1 would communicate with Service 2 (HTTP or Message Queue). Which one is the preferred way ? (HTTP or Message Queue).

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      I mean what your transport layer is between services or how you do it is up to you based on your own requirements I’m not sure I can answer that for you. Nest however has support for both request-response and event-based models, which should cover most typical use cases… e.g. I would imagine your queues by design won’t respond right away so communication via events probably makes sense

  • @AriaBelleMusic
    @AriaBelleMusic 3 ปีที่แล้ว

    Thanks brad marius, Husay!

  • @viacheslavgurin9368
    @viacheslavgurin9368 2 ปีที่แล้ว

    Cool and useful! Thanks!

  • @hannasavostianova7155
    @hannasavostianova7155 3 ปีที่แล้ว

    Awesome! Really helpful!!

  • @solanum1423
    @solanum1423 3 ปีที่แล้ว

    great video and easy to understand! pretty nice for GraphQL beginners
    btw i wanna say nest cli is so strong

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      thanks James! I appreciate the feedback

  • @prateekrajput2646
    @prateekrajput2646 7 หลายเดือนก่อน

    you got a new sub

  • @stuartclove
    @stuartclove 3 ปีที่แล้ว

    Thank you for this Marius. I've always done a very bare-bones setup with GraphQL and Node and was looking for something that could help give some structure and architecture to the APIs I build. This is phenomenal. I built the API along with you, but I couldn't get the "of => Pet" and "returns => Pet" to stop barking about the "of" keyword and "returns" keyword. It wouldn't work until I left them blank "() => Pet". Is that something new in the framework? If not, how do you get those to work? I can't find an answer anywhere on Google. Thanks in advance.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      Hey Stuart, that’s how it is documented to be done in the docs today (having the of/returns), however since you don’t actually do anything with that parameter it shouldn’t hurt to do it your way.. I have a feeling though that you might be importing the decorators from the wrong place though. For example make sure you’re importing Query from ‘@nestjs/graphql’ NOT nestjs/common Which also exports a Query decorator for REST controllers. Otherwise it could also be that the type definition has changed since this video and the docs could be out of date

    • @atg1203
      @atg1203 2 ปีที่แล้ว

      I had the same issue but I figured that it was an eslint warning

  • @krishnamandava9919
    @krishnamandava9919 2 ปีที่แล้ว

    Great one. but I have confusion about @ResolveField() decorater can please explain this decorater

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      It’s meant to resolve a nested field, e.g. if you had a resolver for books, within that you might have the ability to resolve the author of each book

  • @tawhidsultan688
    @tawhidsultan688 3 ปีที่แล้ว +1

    Can you share the repo Link of this demo project ? It can be helpful

  • @erroledricdee7769
    @erroledricdee7769 3 ปีที่แล้ว

    Is there a way to generate Swagger documentation off GraphQL Schema? If yes, can you create a tutorial for this?
    Awesome tutorial by the way!!

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      Thanks! You wouldn’t really typically use swagger for graphql, instead you’d use something specifically designed for graphql like the playground. You need something that allows you to explore the schema, as a form of documentation, and I don’t think swagger would be good for that purpose. It’s more for traditional rest APIs where you’d instead explore endpoints rather than one big schema

  • @julesruzindana-rukundo6254
    @julesruzindana-rukundo6254 5 หลายเดือนก่อน

    hi mate thanks for your very informative videos do you have any idea if i can upload/download images using a dockerized nestjs application with graphql.i cant find any resource online to help me.will my images be uploaded in the container?Thanks in advance.

    • @mariusespejo
      @mariusespejo  4 หลายเดือนก่อน

      You first need to understand the different approaches, then decide on where to store it, e.g. in a dedicated storage something like s3 and not in your container
      I recommend spend some time reading about it
      wundergraph.com/blog/graphql_file_uploads_evaluating_the_5_most_common_approaches

  • @MehdiMoshtaghi
    @MehdiMoshtaghi 2 ปีที่แล้ว

    Thank you so much :)

  • @mohamedabdulla8097
    @mohamedabdulla8097 6 หลายเดือนก่อน

    great man

  • @lil_k_x
    @lil_k_x 2 ปีที่แล้ว

    Thank you for example.
    I would like to know how did you Update and Delete data using Graphql ? I can't see any example here. Did I miss them ?

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      You would use mutations to provide that intent, then it’s up to your resolvers how the update/delete is performed

  • @DevNiklesh
    @DevNiklesh 3 ปีที่แล้ว

    Great content.. loving all of your videos..
    I'm getting "Nest cannot resolve the PetsRepository" error when I implement to query pets from owner. Can you help me resolve this?

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      thanks! typically Nest not being able to find a repository is the result of forgetting to add TypeormModule.forFeature([Pet]) in the imports of the module where you’re trying to use the repo

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      I also just made a recent vid covering relations in typeorm if you want to check that out. Might make it more clear how to make that owner to pet querying work

  • @장재혁-u8d
    @장재혁-u8d 3 ปีที่แล้ว

    Better than any one in udemy 👍 plus, it's free

  • @wjdrk70
    @wjdrk70 3 ปีที่แล้ว +1

    It's very good video! so..do you have a git repository?

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      ah not at the moment for these tutorials sorry!

    • @wjdrk70
      @wjdrk70 3 ปีที่แล้ว

      @@mariusespejo okay😂 thk bro!

    • @Holdino_
      @Holdino_ 3 ปีที่แล้ว +2

      @@wjdrk70 here's mine :) github.com/dannypule/modern-web/tree/master/32-nest-graphql

    • @olabanjoolaleye6159
      @olabanjoolaleye6159 2 ปีที่แล้ว

      @@mariusespejo Please do🙏

  • @mahnoordjaved
    @mahnoordjaved 5 หลายเดือนก่อน

    at 15 min video you are running a video for pets query but you have not imported GraphQLModule in app module

  • @NathanielBabalola
    @NathanielBabalola 3 ปีที่แล้ว

    I'm about to quickly learn GraphQL for a project, is this video a good for a beginner, and also I'm used to Express.js does learning GraphQL mean I have to learn another framework?

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      this is specifically for doing graphql with nest. I don’t necessarily explain graphql in detail in this video. I would suggest you start at the official graphql docs:
      graphql.org/learn/
      then maybe look into some basic tutorials for your framework of choice (e.g express):
      www.howtographql.com

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      think of graphql as sort an alternative to REST. You can use it with any framework that can support it. That includes express. But depending on your needs or preferences it could be that a different framework might be better for you, it really depends

    • @NathanielBabalola
      @NathanielBabalola 3 ปีที่แล้ว +1

      @@mariusespejo thanks for this, guess I'll go to the official docs to get started

  • @goru_nning
    @goru_nning 2 ปีที่แล้ว +1

    If anybody getting error on 'npm start:dev', you should install 'graphql@^15' graphql version 16 does not work for this tutorial!
    Thank you for this video Espejo!

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      Yup, you can track the update required to allow v16 here: github.com/nestjs/graphql/pull/1834

    • @wealthifyme9738
      @wealthifyme9738 2 ปีที่แล้ว

      thanks for saving the day!

  • @afsarzan
    @afsarzan 2 ปีที่แล้ว

    Thank you Marius

  • @joecolas
    @joecolas 2 ปีที่แล้ว

    this is great

  • @tanvirraj
    @tanvirraj 3 ปีที่แล้ว +1

    @Marius can you share the github repo for this code ?

  • @kelvinkwong6365
    @kelvinkwong6365 3 ปีที่แล้ว

    helo, this is a good video to get start on nestjs with graphql, when i keep move on, i try to do pagination in query. is there any tutorial can know more on it?

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      I don’t think I have one myself but it really mostly requires two things: one is you need to know how to do pagination with your ORM/database, for example with typeorm you can use limit/offset properties in queries. Two is you need to know how to add additional params to your graphql query request (basically inputs) which I believe I did cover in this video. You would basically need to have inputs for page/limit and feed that into the ORM query limit/offset

  • @malamhari_
    @malamhari_ ปีที่แล้ว

    Hello, I'm struggling to customize response error/success when using nest-graphql do you have some resources/videos I can learn from?

    • @mariusespejo
      @mariusespejo  ปีที่แล้ว +1

      You need to throw http exceptions from nest, and those should be automatically caught & converted to apollo exceptions
      Look here github.com/nestjs/graphql/pull/1292

  • @ronaldemanuel6557
    @ronaldemanuel6557 3 ปีที่แล้ว

    Nice tutorial

  • @juststudying1019
    @juststudying1019 3 ปีที่แล้ว

    Thanks amazing content 👌

  • @PyroFire-Firework_is_a_passion
    @PyroFire-Firework_is_a_passion 3 ปีที่แล้ว

    Great tutorial, but I'm running into a "Circular dependency" error when implementing the { owner: pets {...} } query.

  • @pareshmaniyar8273
    @pareshmaniyar8273 2 ปีที่แล้ว

    Amazing!

  • @pijusserapinas1641
    @pijusserapinas1641 2 ปีที่แล้ว

    What's that terminal... Typing animation looks sick

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      Hyper terminal, I don’t use it anymore but it’s pretty cool for various customization like that

  • @lancelim1951
    @lancelim1951 2 ปีที่แล้ว

    Hi there! I'd like to ask a question regarding the @Args in getPets query.
    The @Args states that it is taking in an 'id' of type Int but it seems there is a second declaration of id:number? Why is that so?
    Thank you in advance!

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      The Int is representation of the Scalar type for graphql. In javascript there isn’t really an “integer” type only number, so we’re basically saying that Int scalar in the graphql model maps to a number type in javascript. Hope that helps!

  • @franciscollaryora2032
    @franciscollaryora2032 6 หลายเดือนก่อน

    In Implement findOne query, use {where:{id:id}} as argument otherwise it will not compile.

  • @sabianhhxevolution
    @sabianhhxevolution ปีที่แล้ว

    How do you get that animation on your cursor in terminal?

  • @iUmerFarooq
    @iUmerFarooq 6 หลายเดือนก่อน

    Awesome tutorial 🔥
    Make Nestjs course for beginner to advance in 2024 tutorial and also on the same topic 💚
    Thanks a lot

    • @mariusespejo
      @mariusespejo  6 หลายเดือนก่อน

      Thank you, yes hoping to produce more

    • @iUmerFarooq
      @iUmerFarooq 6 หลายเดือนก่อน

      @@mariusespejo Make tutorial on Nestjs guard I know what is guard but I don't know how to implement that in practical projects. I am actually learning Nestjs for the first time.

    • @mariusespejo
      @mariusespejo  6 หลายเดือนก่อน

      I did, if you look in the channel I have videos about nestjs authentication and authorization, which is what you would use guards for

    • @iUmerFarooq
      @iUmerFarooq 6 หลายเดือนก่อน

      @@mariusespejo ok ok please answer my last question.
      How much Nestjs should I know to do job. I am already doing job in database mssql related so I am learning NodeJs/Nestjs I just want to know how to make restapi with validation. What more should I learn. I am actually confused is what kind of projects I will build, and how it is used in market like I will making authentication and authorization Al the time or making api most of the time.
      I hope you understand.

    • @mariusespejo
      @mariusespejo  6 หลายเดือนก่อน

      Not a simple answer, because every job is different. However generally you need to have backend development fundamentals.. Nest is just a tool to help with that. Understand how to create basic REST APIs and how to do CRUD with a database… that is pretty much the main thing. Beyond that depending on your job there maybe other skills like validating requests, auth and maintaining user sessions, working with files (e.g. download/upload), caching, scaling & performance, security, etc.. However most of those things you can also learn on the job, as needed

  • @erroledricdee7769
    @erroledricdee7769 3 ปีที่แล้ว

    In your example you were able to show the owner data when querying for a pet. How do you implement this for the other way around? I tried exporting PetsModule and importing in OwnersModule to do a Pet search via OwnerId via PetsService but I got a "A circular dependency between modules." error.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +2

      Nest has docs on how to deal with circular dependencies: docs.nestjs.com/fundamentals/circular-dependency
      The other alternative is to simply add the other entity to the module, for example if you had: “TypeOrmModule.forFeature( [ Owner, Pet ])” in your module, then the service within that module can inject the repository for both entities without relying on a module dependency.
      Although in theory if you were utilizing relations properly (for example with the find API) I don’t think you even need to do any of that, e.g. you should be able to do something like:
      this.ownersRepo.find({ relations: [‘pets’] }); // returns owners with their pets
      That should work if all you need is to read/join the relation. I believe that’s covered in my video here

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +1

      Actually I misspoke, not in this video but, I have another video in my channel specifically on TypeOrm relations which covers that topic in detail. Maybe check that out

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      th-cam.com/video/rKgZLVgdvAY/w-d-xo.html

  • @maksimzolotoi3379
    @maksimzolotoi3379 2 ปีที่แล้ว

    Dude, how did you setup that caret effect? I want it too!

    • @maksimzolotoi3379
      @maksimzolotoi3379 2 ปีที่แล้ว

      @@mariusespejo cursor when you type something. Pink with effects )

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      On the terminal? That’s the hyper terminal and that effect is just one of the default plugins

    • @maksimzolotoi3379
      @maksimzolotoi3379 2 ปีที่แล้ว

      @@mariusespejo Thanks )

  • @renanbessa9867
    @renanbessa9867 2 ปีที่แล้ว +1

    What would a many-to-many relationship look like?

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      For typeorm? I have a relations vid on typeorm in the channel if you look

  • @TechGenieNP
    @TechGenieNP 2 ปีที่แล้ว

    Can you make tutorial on NestJS with Prisma ORM and GraphQl

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      My teamseas video covers all of that if you’re interested

  • @TigCeX
    @TigCeX 3 ปีที่แล้ว

    Is it ok to use connection from typeorm inside constructor of another service to avoid circular dependency and get to repository? Something like this.ownersRepository = connection.getRepository(Owner) inside pet service.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +1

      yes, but I personally have mostly never had to do that. An alternative would be using TypeormModule.forFeature([Owner]) in the module that you’re having the circular
      Nest also has some ways to prevent issues with circular dependency: docs.nestjs.com/fundamentals/circular-dependency

    • @TigCeX
      @TigCeX 3 ปีที่แล้ว

      @@mariusespejo Ok, thanks for an answer!

  • @dariusdbbowser6329
    @dariusdbbowser6329 3 ปีที่แล้ว

    hey great tutorial, I followed and everything worked until the end. Instead of pets, I changed it to planets and instead of owners, I changed it to factions...but everything else is the same. Getting an error code that says, " Entity metadata for Planets#faction was not found. Check if you specified a correct entity object and if it's connected in the connection options." Uploading it to Github anyway lol

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      I would suggest double checking your ormconfig, specifically the entities property. Make sure you have the right string there which is able to find all your entities

  • @kennethkum187
    @kennethkum187 3 ปีที่แล้ว

    Thanks for the video.
    Please i know you have a video on nestJs authentication, is it possible to use that same authentication in graphql. if yes please make a video to demonstrate how to do authentication in the graphql code and in the playqround.
    If not then please would really love to have a video about authentication in graphql API.

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว

      so the general idea of guards in nest is still usable in the graphql landscape so yes most of those same fundamentals would apply, you likely will just need to make a slightly customized AuthGuard which utilizes the graphql execution context.
      Maybe that gives you some direction for now but anyways I’ll definitely consider making a follow up vid. to further illustrate that. Thanks for the suggestion!

    • @kennethkum187
      @kennethkum187 3 ปีที่แล้ว

      @@mariusespejo Thanks for the hint.

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      fyi just published a new video specifically on auth with graphql, if it's not too late for ya

  • @chikenmacnugget
    @chikenmacnugget 2 ปีที่แล้ว

    i want hearts while typing too. Where is your console theme guide?

  • @ajitsutar5132
    @ajitsutar5132 3 ปีที่แล้ว

    Nice info👍 if you possible to upload MySQL connection and crate Curd application in nest js

    • @mariusespejo
      @mariusespejo  3 ปีที่แล้ว +2

      thanks! It’s honestly the same exact code. The only difference would be to install the mysql driver instead of sqlite. You can actually see an example of that connection object in the nestjs docs here:
      docs.nestjs.com/techniques/database
      There is also more info on the mysql2 driver docs itself:
      www.npmjs.com/package/mysql2
      The rest of the code shown in this tutorial is still relevant. hope that helps!

  • @wiiktor1393
    @wiiktor1393 3 ปีที่แล้ว

    Great video man! Thanks a lot, it was all explained very well

  • @mertgenc9890
    @mertgenc9890 2 ปีที่แล้ว

    what is your terminal theme? I love it :)

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว

      i believe I am using night owl on this video!

    • @mertgenc9890
      @mertgenc9890 2 ปีที่แล้ว

      @@mariusespejo noooo wait. i didn't ask your vscode theme. i asked your terminal theme :)

    • @mariusespejo
      @mariusespejo  2 ปีที่แล้ว +1

      Ohh lol this was using the hyper terminal, I think on a monokai theme

  • @kimhyungchae
    @kimhyungchae 3 ปีที่แล้ว

    코딩 잘하네요👍