Next.js GraphQL API using Apollo Server 3 and Prisma

preview_player
Показать описание

**Timestamps:**
00:00 - Installing apollo-server-micro, graphql & micro-cors
00:50 - Defining a GraphQL schema
03:47 - Including a database URL + Seeding the database
05:13 - Creating the GraphQL endpoint
11:45 - Taking a look at Apollo Studio
14:25 - Initializing Prisma Client
17:35 - Updating the resolver
19:04 - Creating the GraphQL context

Useful links:

------------------------
📚 Resources:

✅ Learn more about Prisma:

------------------------
💬 Connect with Prisma:

------------------------
Рекомендации по теме
Комментарии
Автор

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

MahmoudAbdelwahab
Автор

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 !

dinoscheidt
Автор

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

desireed
Автор

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

prfanator
Автор

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

heuvije
Автор

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

MichaelShingo
Автор

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

LewisRidyard
Автор

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!

AdityaKarnamGRao
Автор

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

brandonly
Автор

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

BatgioK
Автор

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

MatthewHinton
Автор

still getting CORS issues about access-control methods.

timezcooler
Автор

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.

adimaralimuddin
Автор

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?

danielacosta
Автор

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.

adimaralimuddin
Автор

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

viacheslavshakhnazarov
Автор

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.

carlosdubon
Автор

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?

trenom
Автор

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

liltripple_reid
Автор

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 ?

ntro-p