Build A Live News API with Apollo Server V4 Subscriptions and GraphQL (TypeScript Tutorial)

  Рет қаралды 5,138

Cooper Codes

Cooper Codes

Күн бұрын

Enjoying my videos? Sign up for more content here: www.coopercodes.com/
📩 Join codeLetter by Cooper Codes, the 3 minute tech newsletter: thecodeletter.com
Interested in a 1:1 mentorship with me? Jumpstart your career at www.rebrand.ly/coopercodesmen...
In this video we dive deep into Apollo Server V4 subscriptions and using the graphql-ws library to create a scalable Apollo Server API that allows users to view live events. This video is perfect for anyone looking to create any system that requires live data and is just the start to what you can create using powerful technologies such as subscriptions. This is also a great introduction to GraphQL and what GraphQL looks like when working with Apollo Server typedefs and resolvers.
Final Code: github.com/coopercodes/LiveNe...
Buying stuff through my Amazon link supports the channel! amzn.to/3hK5gd0
Business inquiry? Email thecoopercodes@gmail.com
0:00 Intro / Project showcase
1:00 npm installs / package.json setup
2:38 Initial server.ts code
4:58 Defining typedefs and resolvers
12:50 Finishing up server logic
19:35 Create GraphQL Mutations / Subscriptions
21:43 Thanks for watching!

Пікірлер: 25
@paulthomas1052
@paulthomas1052 Жыл бұрын
Great introduction to Subscriptions. Thanks. :)
@junjieyang7800
@junjieyang7800 9 ай бұрын
thank you so much, I have been looking for something amazing like this!
@armanulalam4560
@armanulalam4560 Жыл бұрын
I was struggling to understand the subscription part of apollo graphql documentation. This video helped me a lot. Thanks ]
@DS-fr3kk
@DS-fr3kk Жыл бұрын
This helped a lot. Thanks 🙏
@CooperCodes
@CooperCodes Жыл бұрын
You are very welcome. Thanks for watching!
@neerajr7176
@neerajr7176 7 ай бұрын
Thanks alot
@marianodiez5274
@marianodiez5274 4 ай бұрын
Thx a lot for this amazing video, I am trying to do the same but I want to use Hapi instead express, do you have any other video or documentation that can I use?
@nwaformicah433
@nwaformicah433 Жыл бұрын
Thanks, great job and we appreciate. Can you do some tutorial on apollo express error handling
@CooperCodes
@CooperCodes Жыл бұрын
Doing a video on Apollo Server GraphQL error handling today :) be on the lookout!
@nwaformicah433
@nwaformicah433 Жыл бұрын
@@CooperCodes thanks so much, you are the best
@martinapincione6429
@martinapincione6429 Жыл бұрын
Hello, I am able to successfully make a mutation but when I do subscriptions I get a status error saying it's unable to connect to the ws://localhost:4000/graphql. Do you know what might be causing this issue? I even tried cloning you git code and running it on my local machine with no success
@yamikaperera9576
@yamikaperera9576 Жыл бұрын
having the same issue! Did you get any solutions?
@Tauseef_Hilal
@Tauseef_Hilal 4 ай бұрын
same for me. Got it working?
@logindharam
@logindharam Жыл бұрын
how can i create a seperate file for schema and resolver for the same
@alexmcclay8152
@alexmcclay8152 Жыл бұрын
I also had this issue, and I was struggling for a while as well but this is the solution. Lets say I have my typeDefs and resolvers in a schema.ts file in the same directory as the server.ts you import them like this assuming they aren't default exported. import { typeDefs, resolvers } from "./schema.js"; you still do 'schema.js' even if its a .ts file.
@justiceellis6895
@justiceellis6895 Жыл бұрын
@@alexmcclay8152 I Implemented this and it worked perfectly, Thank you 😊
@gofudgeyourselves9024
@gofudgeyourselves9024 4 ай бұрын
Thank you
@tobias5073
@tobias5073 Жыл бұрын
do you have this in JavaScript?
@Civilizer1976
@Civilizer1976 Жыл бұрын
kzbin.info/www/bejne/qKi5pKeradmmndE
@user-zn5cz6tq3l
@user-zn5cz6tq3l Жыл бұрын
source code please
@CooperCodes
@CooperCodes Жыл бұрын
It is here: github.com/coopercodes/LiveNewsAPI
@Victor-wh9bs
@Victor-wh9bs Жыл бұрын
GraphQL
@CooperCodes
@CooperCodes Жыл бұрын
Yep, back at it! More Apollo Server V4 content soon
@logeshr7935
@logeshr7935 9 ай бұрын
if I deploy this server on production I get this message: Send a POST request to query this endpoint: ------------------------------------------------------------------------------------------------------------------------------------------------------ curl --request POST \ --header 'content-type: application/json' \ ------------------------------------------------------------------------------------------------------------------------------------------------------ any help?
Create A GraphQL API with Apollo Server V3 and MongoDB Atlas
36:27
Cooper Codes
Рет қаралды 31 М.
Tom & Jerry !! 😂😂
00:59
Tibo InShape
Рет қаралды 50 МЛН
Next.js 13 Google Login (NextAuth V4 / TypeScript Tutorial)
18:22
Cooper Codes
Рет қаралды 14 М.
SvelteKit Drag And Drop List With svelte-dnd-action
16:56
Cooper Codes
Рет қаралды 6 М.
How to Auth: Secure a GraphQL API with Confidence
25:18
Apollo GraphQL
Рет қаралды 40 М.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 64 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 151 М.
Нашел еще 70+ нововведений в iOS 18!
11:04
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,1 МЛН