GraphQL with Apollo Server 2.0

Sdílet
Vložit
  • čas přidán 13. 06. 2018
  • Learn how to build an API using GraphQL with Apollo Server 2.0, using Firestore as a backend data source. github.com/arjunyel/firestore...
    - Get more episodes at angularfirebase.com/
    - GraphQL graphql.org/learn/
    - Apollo 2.0 www.apollographql.com/docs/ap...
  • Věda a technologie

Komentáře • 126

  • @mateja176
    @mateja176 Před 6 lety +171

    If you are a web developer nowadays, this is THE channel to follow!

    • @Fireship
      @Fireship  Před 6 lety +6

      Thank you Mateja! Spread the word :))))

    • @aperson9375
      @aperson9375 Před 6 lety +4

      Ha ha, I always follows ways he shows in his videos.

    • @rubenheymans1988
      @rubenheymans1988 Před 6 lety +4

      this guy deserves much more subs

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj Před 5 lety +1

      just discovered it.. decent.. there's many good channels...
      Pretty sure mongodb hasn't replaced postgres tho.. .
      There's myriad of tools, people use different tools.. that's it..
      just like in construction for example.. some people use husqvarna, some people use makita...
      tools are just tools ...
      any developer who talks too much about this tool and that tool... is a sure sign of a shitty coder...

    • @raghavgupta1157
      @raghavgupta1157 Před 2 lety +1

      Word

  • @sebastianhernandez6504
    @sebastianhernandez6504 Před 4 lety +1

    i love how you explain everything that matters in such a concise way

  • @Fireship
    @Fireship  Před 6 lety +62

    Will GraphQL replace REST in the near future? I'm not sure, but GraphQL is definitely a fun way to build an API

    • @ethanchiasson9956
      @ethanchiasson9956 Před 4 lety +2

      Malik Bagwala GraphQL MAY not be worth in some instances.

    • @1gouravgg
      @1gouravgg Před 4 lety

      How about the performance? if GraphQL needs another server (apollo) to route queries then that adds extra latency. That's not the case with REST API. If it's performance hit then graphQL can't replace REST API anytime in future.

    • @vighnesh153
      @vighnesh153 Před 4 lety +6

      @@1gouravgg I don't understand the "another server" phrase. Apollo is a GraphQL server that recursively maps the resolvers to the requested query (or mutation or subscription). There is just a single server just like an express server or any rest API server. A REST API server maps the routes to the respective controllers. How does the Apollo server add up extra latency as it is doing a similar thing?

  • @WittyGeek
    @WittyGeek Před 6 lety +4

    I must say your videos are a gem and maybe the most highly under-rated amongst all the Angular based videos on CZcams!! Keep up the good work!!!

    • @Fireship
      @Fireship  Před 6 lety +1

      +Sagar Thank you, really appreciate your feedback :)

  • @CodeRealm
    @CodeRealm Před 6 lety +3

    Awesome, I absolutely love the video format!

    • @Fireship
      @Fireship  Před 6 lety

      Great to hear that, thanks for watching :)

  • @luciusrex
    @luciusrex Před 5 lety +10

    In terms of client-side performance, would getting a firestore collection doc and a subcollection doc be faster than a graphql query to two collections? Or would it cost (client-side performance) the same as they both have two api calls anyway?

  • @raymondmichael4987
    @raymondmichael4987 Před 6 lety +3

    I just hit like even before watching bro, thanks for this,
    As I'm about to go angular soon.
    Greetings from Tanzania

    • @Fireship
      @Fireship  Před 6 lety +1

      Thank you, I've always wanted to visit Tanzania :)

    • @raymondmichael4987
      @raymondmichael4987 Před 6 lety +1

      Angular Firebase, that's amazing bro, please don't hesitate to visit or ask anything about Tanzania (I'll help you for insights), I reside in Bagamoyo (very historical site), please welcome, take a tour in this majestic land, Tanzania

  • @hamzaamdouni
    @hamzaamdouni Před 6 lety

    Awsome work! waiting for more ;)

  • @NightsArrowz
    @NightsArrowz Před 5 lety

    Love it, more more Angular + GraphQL

  • @MrLuc420
    @MrLuc420 Před 6 lety +2

    I love these videos more than I should.

  • @ameerattaa2250
    @ameerattaa2250 Před 6 lety +1

    thanks for all the good and new content

    • @Fireship
      @Fireship  Před 6 lety

      Thank you for watching :)

  • @reyco1
    @reyco1 Před 6 lety +17

    Hold on, hold on, hold on!!! Holy Shit, Jeff! I had to literally pause at 10 seconds man! That intro was SIIICCCKKK!!!! Very cool, man! Ok, back to watching the rest of the video :)

  • @ssokurenko
    @ssokurenko Před 6 lety +4

    Nice tutorial! It could be also useful to show how to execute a mutation, for example adding another tweet for a user.

  • @KashifMinhaj
    @KashifMinhaj Před 5 lety

    Great tutorial. I've always been wanting try graphQL but I'm still not sure how to provide apis that are not meant for fetching the data? There could be apis that are meant to trigger something or mutate a data store. How does that work if you have a GraphQL server ?

  • @gFamWeb
    @gFamWeb Před 6 lety +1

    This is really important for security as well. I found this one fairly popular social media app which has a very open API. Users (and any posts tagged with a location) had full coordinates returned via the internal API (found using a packet tracker). What was worse was that, until recently, you could POST (as in a POST request) to your profile that you were a member of the app team (i.e. an employee of the company who makes the app), and you would get a badge on your profile. They've since fixed that, but I have found you can still POST other things to your profile that you shouldn't be able to change. Something tells me they just added an if statement to ignore that specific "app team" parameter from any POST requests.

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt Před 6 lety +2

    Thank u for this awesome video

    • @Fireship
      @Fireship  Před 6 lety

      Thanks for watching Abhishek

  • @narcodico
    @narcodico Před 6 lety +57

    GraphQL is doing to REST what json did to xml.

  • @carrillocarlosce
    @carrillocarlosce Před 6 lety +2

    Sounds interesting thanks !!!

    • @Fireship
      @Fireship  Před 6 lety +1

      It's definitely something to put on your radar.

  • @MattCampbellMAXXtreme
    @MattCampbellMAXXtreme Před 5 lety +3

    How do you get that dark mode version of GraphiQL? It looks a lot nicer & more updated than GraphiQL.

    • @JagaSantagostino
      @JagaSantagostino Před 3 lety

      Matt Campbell is called graphql playground, built in in apollo server

  • @moisesnunez6915
    @moisesnunez6915 Před 2 lety +1

    Watching this for the first time and that tweet in the beginning had me shook haha (the bootcamp Im currently in is only teaching REST with PostgreSQL)

  • @deriegle
    @deriegle Před 6 lety

    Thank you so much for this video Angular Firebase!
    When do you think you'll do part 2? Really excited to see how to implement GraphQL in Angular. I have used it with React, but I really want to implement it into Angular projects as well.

    • @Fireship
      @Fireship  Před 6 lety

      Yes, part 2 is done, working on the video now :)

  • @devilmanscott
    @devilmanscott Před 6 lety +4

    While I do think there's a good chance that Graphql will replace most use cases of Rest, I pretty much use Graphql exclusively now, but Mongo did not in any way replace Postgres, I'd say we've got even more of a large selection now graph databases are starting gain popularity.

    • @Fireship
      @Fireship  Před 6 lety

      I agree, his tweet had the right idea but not the best comparison. I think XML vs JSON might be a slightly better one.

  • @OzaTv
    @OzaTv Před 5 lety +3

    You should make a video about graphQL and serverless (cloud functions)

  • @TheGrafox
    @TheGrafox Před 6 lety +3

    Please more about QraphQL With Angular ... like authentication , ... Maybe full list of videos on pro account ... Thanks

  • @RodyDavis
    @RodyDavis Před 3 lety

    Is it better to do it on firebase functions now?

  • @SwapnilSoni
    @SwapnilSoni Před 3 lety +1

    we need an updated video :3

  • @gregs_on_tracks
    @gregs_on_tracks Před 5 lety +15

    Lol that starting quote. Postgres is arguably doing better than Mongo.

    • @RayBarrera
      @RayBarrera Před 4 lety +1

      Glad I'm not the only one that thought that. Not to mention, why the Postgres comparison specifically?

    • @daheck81
      @daheck81 Před 3 lety

      I don’t really get why would you compare two different kind of DBs in general? They are both doing fine and they are both better at different things. It really depends on the project you’re building. I could understand a "What PostgreSQL did to MySQL“ analogy but comparing 2 different db systems is hilarious

  • @shafeekmohamed9712
    @shafeekmohamed9712 Před 4 lety +1

    Is Apollo Server free to use, self hosted?

  • @kmehtab29
    @kmehtab29 Před 5 lety

    which theme r u using

  • @bouwepuntnl
    @bouwepuntnl Před 4 lety +4

    Great tutorial! 💯
    You seem to paste in every line of code instead of typing it character for character, which looks very cool and is less distracting because there are no typos.
    How do you that? 😃

    • @hugot8226
      @hugot8226 Před 3 lety +4

      I think he saved his file, deletes lines one by one and then just reverse the deletion during recording...I may be wrong but that's how I would do that !

    • @brendon205
      @brendon205 Před rokem

      my guess is that he deletes line by line from bottom to top, and then undo it one by one

  • @carltongordon
    @carltongordon Před 6 lety +1

    Hey Jeff thanks man, are you still using angular 5?

    • @Fireship
      @Fireship  Před 6 lety +2

      I'm using Angular 6 mostly now.

    • @carltongordon
      @carltongordon Před 6 lety

      Awesome Thanks, is it possible you can do a video on Angular 6 Updates? i want to upgrade but i dont want to end up with a nest of bugs lol

    • @Bielik20
      @Bielik20 Před 6 lety +1

      Hi Carlton, I would follow the official update guide (update.angular.io/). Most changes are not that breaking, the hardest part is rxjs update. They have prepared tool to make it easier, they say it will update automatically... it won't but it will help. Good luck with your update, it really isn't that scary ;)

    • @LEKKIIEE
      @LEKKIIEE Před 6 lety

      medium.com/@jeroenouw/upgrade-to-angular-6-4520e46c682b Here is a great article to do that, hope that helps !

  • @benjaminjameswaller
    @benjaminjameswaller Před 6 lety

    Thanks Jeff. nice video. Have you done any videos on xAPIs particularly getting user analytical data from education apps such as H5P into an LRS or Google analytics? just interested in how to do it. great work mate

    • @Fireship
      @Fireship  Před 6 lety

      No, I have not done anything like that. What's your use case? Sounds like it could make an interesting topic

    • @benjaminjameswaller
      @benjaminjameswaller Před 6 lety

      Ok. I'll message you on Slack.

    • @benjaminjameswaller
      @benjaminjameswaller Před 6 lety

      Hi Jeff. I messaged you directly on Slack with some details, Did you get it?

    • @Fireship
      @Fireship  Před 6 lety

      I did, sorry for the delay. I wanted to research some of the tools you listed. I will get back to you there tomorrow.

  • @razakadam74
    @razakadam74 Před 6 lety +1

    Hello Jeff, Abdul-Razak here again. Great video as usual. How is the student sponsorship program coming along? I am still hanging in here :)

    • @Fireship
      @Fireship  Před 6 lety +1

      Are you on the Slack channel? Send me a direct message - I think I can help you out :)

  • @JayRGabz
    @JayRGabz Před 4 lety

    how do you copy paste???

  • @voiceofthetrue1849
    @voiceofthetrue1849 Před 6 lety +1

    That was really helpful , but what if we have form of multiple search inputs to search for certain car for example between two amounts with model year, color, price, where user can choose either one input, bunch or all of theme at the same time?

    • @Fireship
      @Fireship  Před 6 lety

      It really depends. You might handle most of that filtering client side or use a full text search service like algolia.

  • @gbarosio1
    @gbarosio1 Před 2 lety

    0:09 There should not be predictions but compelling thoughts on how different technologies address a problem efficiently, or not. There will always be a case in which REST is an optimal solution, as well as a case for GraphQL. As well as for C, C++, Perl, React or Typescript; you name it. Pretending that a Graph (form a math definition) will replace REST, is simply comparing peaches and bananas, they are fruits, and you eat them, but they are not the same thing.

  • @omarkbrown
    @omarkbrown Před rokem

    wait when did MongoDB replace PostgreSQL?

  • @vengadorweb
    @vengadorweb Před rokem

    Hey man, can you do a tutorial about apollo client + ssr next.js 13? Great vids btw!

  • @easychurchaplicativos8793

    I can not put it to work. Gives the following error:
    “ node_modules/apollo-env/lib/polyfills/array.d.ts:1:1 - error TS1084: Invalid 'reference' directive syntax. 1 /// “
    Can someone help me?

    • @csaba8211
      @csaba8211 Před 5 lety

      Hi, Did you managed to solve it? I run into the same problem in one of my project.

  • @alexandertarasenko3038

    I think graphQL doesn't offer full functionality completely for now. Maybe I am wrong...
    Files uploading, access restriction, auth with google, etc....
    Also as a newbie I have lot of quesitons like express-graphql or apollo-express graphql?
    Is it working okay with ngRx?
    What about websockets for example?
    Also strong typed Schemas, which mostly duplicate mongoose Schema...
    Looks like it solves one problem but creates hundred of new ones...
    I am not a hater but I really try to understand when to use graphQL?

    • @Fireship
      @Fireship  Před 5 lety

      I agree with you actually, it will create more problems that it solves in many apps. You should have (1) large relational APIs (i.e. Yelp!) that (2) may need to combine several data sources on a single request and (3) have multiple client apps that drive the development decisions.

  • @okbrown
    @okbrown Před 5 lety +5

    Didn't explain well enough how the resolver knows how to return the the tweets for a given user. And how that mapping occurs.

  • @clonger204
    @clonger204 Před 2 měsíci

    Aww baby Jeff

  • @Ebokk
    @Ebokk Před 4 lety

    Hey all, Please tell me which is the best kind (Firebase vs Heroku)

  • @awildeep
    @awildeep Před 5 lety +2

    Wait, Mongo replaced PostgreSQL? Cough... maybe for a use case or two, but replaced? LUL.

    • @Fireship
      @Fireship  Před 5 lety

      That was a joke - GQL is cool, but probably overkill in most situations.

  • @chanlito_
    @chanlito_ Před 6 lety

    Apollo Server 2.0 or GraphQL Yoga?

  • @zoecarlibur
    @zoecarlibur Před 5 lety +2

    But technically isn't this more work? It's like an API for your API.

    • @florianneumann9441
      @florianneumann9441 Před 5 lety

      Depends on what kind of problems you want to solve... you can use GraphQL/Apollo-Client to combat different Problems - You can use it handle local application-state ( replace something like redux ), solve over-/under-fetching ( as you make one request to your api and can request exactly the fields you need to display - afterwards if you request the same/or data containing already requested fragments - it comes from cache ), Stiching together multiple sources and apis ( Multiple Rest Apis/Databases etc. and Query them as One ). Also it's very powerful that you can adapt your queries in the frontend, without the need to adapt it on database-level. Furthermore their are a tools to generate an graphql-layer over existing rest-apis and mocking tools you can use to simulate your database before implementation and for testing...

  • @miettoisdev
    @miettoisdev Před 3 lety +1

    holy shiet, "MongoDB replaced PostgreSQL". dude's got some nerve.

  • @hwkd5416
    @hwkd5416 Před 5 lety +4

    MongoDB didn't replace PostgreSQL.. they have completely different use cases..

    • @omnitool
      @omnitool Před 5 lety

      which is actually apt. GraphQL/REST have completely different use cases. But I think, like mongo, a lot of projects are going to use graphQL like its the future and make it much harder on themselves and end up with much shittier code because they didn't realize the pros/cons.

    • @dutchman55
      @dutchman55 Před 5 lety

      Microsoft might disagree as when they were tasked with building a worldwide scalable server they ultimately went the document based nosql route and decided to allow for SQL apis to interface with it.

  • @viniciusataidedealbuquerqu2837

    I don't think that solved the n+1 problem...

  • @DanielRLuke
    @DanielRLuke Před 6 lety +1

    ReST in peace..

  • @osagiee9553
    @osagiee9553 Před 4 lety

    I switched from MongoDB to PostgreSQL...

  • @daksh6752
    @daksh6752 Před 5 lety

    he uses kde plasma.

  • @michelingesoft
    @michelingesoft Před 5 lety +21

    MongoDB replacing postgresql HAHAHHAHAHAHAHH

  • @saadabbasi2063
    @saadabbasi2063 Před 5 lety

    Umm,
    Improvements could be made, Its angular + Firebase + Cloud fns + apollo, the topic and focus of this video starts to fade and its too much to absorb and focus on,
    If its about Apollo, expect Angular there shouldn't be much other than that. :)

  • @vickylance
    @vickylance Před 4 lety

    the graphql-express-server seems far better than this apollo server. The code can be more easily organized and understood in the graphql-express-server than this.

  • @ManuelMontoyaRdz
    @ManuelMontoyaRdz Před 5 lety +1

    If you are replacing PostgreSQL with MongoDB you are a mediocre developer.

  • @yashlalit3036
    @yashlalit3036 Před 3 lety +1

    WHY THE FUCK EVERYONE HAS MADE A VIDEO SHOWING HOW TO RETRIVE DATA !! PLEASE MAKE A VIDEO ON HOW TO UPLOAD DATA !!!!!!!!!! PLEASE I AM IN URGENT NEED ON HOW TO GET THAT WORK DONE.

  • @tobyflenderson7176
    @tobyflenderson7176 Před 6 lety +1

    how tf is he just pasting code. it's annoying af.

    • @Fireship
      @Fireship  Před 6 lety +1

      It's a patented method that I describe in Episode 100. It's either that, or make this video 1hr long.

    • @tobyflenderson7176
      @tobyflenderson7176 Před 6 lety

      Angular Firebase link?

    • @Fireship
      @Fireship  Před 6 lety +1

      czcams.com/video/V0HW6h0Jzog/video.html start watching around 3:40

    • @ChrisEsplin
      @ChrisEsplin Před 6 lety +2

      It's not ideal... but I've shot a lot of screencasts myself, and you've got to speed up the typing or everyone will cry with boredom.