Next.js GraphQL API using Apollo Server 3 and Prisma

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 58

  • @MahmoudAbdelwahab
    @MahmoudAbdelwahab 3 роки тому +24

    Hey friends, one thing I forgot to do is install the `micro` package. Some of you may run into an error because of that

  • @dinoscheidt
    @dinoscheidt 3 роки тому +16

    Guys, I gotta say: You Dev Advocates do an excellent job in providing contained end-to-end examples to smoke test potential use cases without firing up a dev environment myself. Including great audio, time stamps and skipping the whole “everyone is a beginner assumptions so lets explain GraphQL again” mantra. That is very pleasant. We are looking into using Prisma & GraphQL now in a large Machine Learning system to facilitate the schema maintenance and combination for the AI Feature Store so Machine Learning Engineers have a one stop shop for assembling their feature layers at will to experiment and iterate on Machine Learning Models. I would not consider Prisma without having the feeling that it is solid and proven tech - and the content you create provides that feeling despite Prisma being relatively new compared to the world of Apache XYZ alternatives. So good job; greetings from Berlin to Berlin/SF !

    • @PrismaData
      @PrismaData  3 роки тому +3

      Hello there! Thank you so much for this amazing feedback!
      We're so happy to hear that you're enjoying the content that our DevRel team is producing and that that's giving you the confidence to consider Prisma for your Machine Learning project.
      We'd love to learn more about your experience as your project progresses, and any feedback or pain points you can share with us! 💚
      Greetings back from Berlin and SF! 😉

    • @danielacosta1292
      @danielacosta1292 2 роки тому

      wow! I find it very interesting. I would like to know more about AI applications of this type, any blog or publication where I can read a little more about this type of similar applications? Thank you

  • @desireed7115
    @desireed7115 3 місяці тому

    Wow!! My mind has exploded in 20min! Great Job!! You are a VERY good instructor!! Thanks!

  • @LewisRidyard
    @LewisRidyard 3 роки тому +4

    This was such a well explained, well rounded tutorial. Bookmarked. Great stuff!

    • @PrismaData
      @PrismaData  3 роки тому

      That's awesome, we're glad you enjoyed it! 💚

    • @markcuello5
      @markcuello5 2 роки тому

      Which one?

  • @AdityaKarnamGRao
    @AdityaKarnamGRao 2 роки тому

    I was missing the micro cors and broke my head for 2 hours. Finally thanks for the walkthrough it was great and it worked for me. Cheers!

    • @markcuello5
      @markcuello5 2 роки тому

      Yeah, but what are the `micro cors`?

  • @Sbz-i2c
    @Sbz-i2c Рік тому +2

    thanks for your tutorials. however, it would have been nice to finish the 1st part with postgres db and actually use the db...

  • @brandonly7634
    @brandonly7634 2 роки тому

    Awesome!!! Love this so much. Great tutorial, and I absolutely love love love this stack.

  • @MichaelShingo
    @MichaelShingo 4 місяці тому

    If anyone is wondering how he has syntax highlighting inside the gql``, you need to install the VSCode extension, Apollo GraphQL.

  • @pr0fanator
    @pr0fanator Рік тому +3

    One problem of those technologies, that is to much changes... To fast to maintain stable business application.

  • @BatgioK
    @BatgioK 2 роки тому

    Great tutorial!! explained all the extra little stuff I was banging my head on for hours. liked subbed commented, Good job

  • @atheerapeter5174
    @atheerapeter5174 3 роки тому +3

    more of this please

  • @danielacosta1292
    @danielacosta1292 2 роки тому +1

    Do you have an idea of how many simultaneous accesses your production website supports before it becomes a problem for your DB? Or passing prisma client in the context reuses the instance between calls to your api?

  • @100timezcooler
    @100timezcooler 3 роки тому +2

    still getting CORS issues about access-control methods.

  • @adimaralimuddin96
    @adimaralimuddin96 2 роки тому +1

    we would love to learn how to setup the right way or right archetecture for building a full nextjs project with best practices. we would love to learn about neo4j, nexus and what makes a better nextjs app... that would be great.

  • @igotbit9454
    @igotbit9454 2 роки тому

    perfect. very helpful thanks.

  • @MatthewHinton
    @MatthewHinton 3 роки тому +4

    This is a really good tutorial. PS what VSCode theme are you using?

    • @PrismaData
      @PrismaData  2 роки тому +1

      Hey there 👋🏽
      Mahmoud is using the GitHub Vs Code Theme: marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme

    • @markcuello5
      @markcuello5 2 роки тому

      Which tutorial?; and: ?

  • @liltripple_reid8917
    @liltripple_reid8917 3 роки тому

    hey I'm getting a weird error that says 'error - Error: called start() with surprising state started' any ideas?

  • @carlosdubon8539
    @carlosdubon8539 Рік тому +1

    I have a question. Do I have to create a GraphQL schema and a Prisma schema. Or is there a way to codegen one (GQL Schema or Prisma schema) based on the other.
    For eg. If I already have a Prisma Schema can I run a CLI command that codegens the GQL Schema for me?
    I'm new to both of these technologies and I'm wondering if it's a best practice to create 2 schemas. Because we lose the "single source of truth". And it's as against the "don't repeat yourself" principle as well.

    • @naylord5
      @naylord5 Рік тому

      I have the exact same question, do you find any solution for this?

    • @carlosdubon8539
      @carlosdubon8539 Рік тому

      @@naylord5 well after months of working with them it seems to be the norm. To have a Prisma schema and a GraphQL schema. This is because your end API has a different schema than your database (after creating relations etc).
      For e.g.
      You can have a Prisma schema that contains the names of famous artists. But in your GraphQL API only have a "artistsCount" property.

    • @naylord5
      @naylord5 Рік тому

      @@carlosdubon8539 Oh I see, thank you for your input.
      It sounds really tedious, hoping you only need to do that once or twice per project if the schema doesn't change often.

  • @euanmorgann
    @euanmorgann 2 роки тому

    How would this work with getStaticProps etc?

  • @trenom
    @trenom 2 роки тому

    Sorry but I was just wondering, why use GraphQL to fetch only the data we want when Prisma allows us to do the same thing with their select and include APIs?

  • @viacheslavshakhnazarov3612
    @viacheslavshakhnazarov3612 Рік тому

    how i can get data rom db, not from .ts file?

  • @ankurvishwakarma8731
    @ankurvishwakarma8731 2 роки тому

    Awesome :)

  • @adimaralimuddin96
    @adimaralimuddin96 2 роки тому +1

    prisma-client, apollo-client and apollo-server are sometimes confusing at startup and i missed them up like a lot of times. probably because it is something that you don't do a lot.

  • @falsifyingdream
    @falsifyingdream 2 роки тому

    I'm having trouble with _parent, _args, and ctx typing with Typescript (around 18:08 in the video). I'm having to type them as 'any' to get the TS errors to go away. Is there a simple fix for this?

  • @thomas-sinkala
    @thomas-sinkala 3 роки тому

    Thank you, Mahmoud, I am using javascript. Any idea how to add the promise type to the context as in 20:18 time stamp?

    • @PrismaData
      @PrismaData  2 роки тому

      Hey there 👋🏽
      If you're using VS Code as your editor, you can use JS Doc to annotate types to your code. Here's a link to a gist you can use to add types to your JavaScript code: gist.github.com/ruheni/9df3cca7c0f73f7f4c9002cf8657a38c 🙂
      Let us know if you run into any issues.

  • @orozcorp
    @orozcorp Рік тому

    Hey, since apollo-server-micro is deprected, how would you migrate this to apollo server 4?

    • @PrismaData
      @PrismaData  Рік тому

      Hi 👋🏽
      We've updated the written course to use Pothos and GraphQL Yoga.
      Let us know if you run into any issues. 🙂

  • @lucabaxter4002
    @lucabaxter4002 2 роки тому

    What font are you using in vs code? looks so cool and clean!

  • @yehudamakarov
    @yehudamakarov 2 роки тому

    What are you using for your terminal that provides the documentation for flags

    • @PrismaData
      @PrismaData  2 роки тому

      That's a tool called fig - fig.io

  • @yashuapervez1533
    @yashuapervez1533 3 роки тому

    is there any limitations of using, apollo-server-micro. dose this package offers all the features available in core apollo-server.

    • @MahmoudAbdelwahab
      @MahmoudAbdelwahab 3 роки тому +1

      Hey Yashua! The package contains all features available in apollo-server. It's just optimized to be used in serverless environments like Next.js

  • @DavidAbishay
    @DavidAbishay 3 роки тому

    I've installed cors and micro but still getting ReferenceError: cors is not defined for function. Problematic line seems to be: export default cors... any ideas? Great tutorial, thank you!

    • @MahmoudAbdelwahab
      @MahmoudAbdelwahab 3 роки тому

      Hey David! you should be installing micro-cors and micro. No need to install cors. Hope that helps! Let me know if you're still running into the error

    • @markcuello5
      @markcuello5 2 роки тому

      I would stay away from `cors` and `micro`.

  • @ntro-p
    @ntro-p 2 роки тому

    Super solid video! Using it to set up my project. One uncertainty I have though, isn't micro not designed to be used in serverless environments? They have a disclaimer for it in their readme
    I guess futhering my question, why is micro being used here rather than apollo-server + cors ?

    • @markcuello5
      @markcuello5 2 роки тому

      1st part: which video? 2nd part: I don`t know.

  • @herbertk9266
    @herbertk9266 3 роки тому

    Thank you

  • @kamalkamals
    @kamalkamals 2 роки тому

    16:04 should update ur code for nodejs higher thatn 14.x, then if using ts should define type of each arguments of function

  • @kamalkamals
    @kamalkamals 2 роки тому

    this example it s for a small app, not recommended for medium or big app

  • @markcuello5
    @markcuello5 2 роки тому

    Help me

  • @misterbg1
    @misterbg1 8 місяців тому +1

    you do a lot of 'oh yeah we need this cuz it wont work without it'. Not alot of explaining the specific reason. You're providing code to copy, why not explain it more in depth, there is no context here