GraphQL Tutorial #22 - Adding a Front-end
Skills:
API Design80%
Key Takeaways
Adds a front-end to a GraphQL server using React and Apollo
Full Transcript
alright then so this is the situation now we have our Express up and graph key our server built on nodejs and we've hooked this up to MongoDB so when we make test requests from the front-end in this tool called graphical we're sending those to the server and the result functions over here going out to MongoDB to retrieve the information we need return it to the server which is then determining what data to send back to the user in the browser dependant on the query that was made so this is all well and good we've kind of taken care of the right-hand side of this equation all of the server and the database stuff but ideally going forward we don't always want to be just making requests or queries from this tool called graphical I imagine at some point what we'd like to do is make an application in the browser some kind of website and then allow that to make queries to the graph of our server over here and retrieve data from it so it can show it to the end-user using that website so we want to replace graphical with some kind of app we're going to use react to flush out an app on the front end now because graph QL query language is not JavaScript although it looks like it is not then out of the box it's not understood by react or any other kind of JavaScript framework on the front end now to help us kind of bind graph QL to our application we're going to use a graph QL clients and one of those is called Apollo so this is the thing we're going to be using to help bind graph QL to I will react app so that we can make queries using graph QL to our server all right so just to break this down a little bit more we're gonna have our react app we're gonna have a couple of different components maybe even three but it's gonna look something like this we'll have a book list component which will render a list of different books then we'll also have an ad book component which will be a form of some description to add a new book to that list so in both cases right here these components are going to be making queries right to the server this top one to get a list of all the different books and this one right here to add a new book to make a mutation so the way this is going to work is we bind queries to our components right and the way we do that is by using this Apollo clients so Apollo can help us create a query and then bind that query to a component so that when that component renders in the browser automatically behind the scenes Apollo is handling that query to the server and returning any information so that we can show it inside the component and this works really well with react and you'll see exactly how this works as we go forward all right so when the graph QL server receives that query then it's going to go to M lab but get the data and return it back to us so that's basically how this application is going to look now to flesh out this front-end application we're going to be using this create react app okay so you can find that on github I'm going to leave this link down below it's by Facebook and it's really simple to use but basically all we're going to be doing is creating a react app using this command in our console so we're going to start doing that in the very next tutorial
Original Description
Hey gang, in this GraphQL tutorial, we'll look at how we can tack-on a front-end to our GraphQL server. We'll do this using React (and Apollo).
DONATE :) - https://www.paypal.me/thenetninja
----- COURSE LINKS:
+ Course files - https://github.com/iamshaunjp/graphql-playlist
+ Atom editor - https://atom.io/a
+ CMDER - http://cmder.net/
+ Node Download - https://nodejs.org/en/
======== Other Tutorials =========
----- NODE.JS TUTORIALS
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp
----- MONGODB TUTORIALS
https://www.youtube.com/playlist?list=PL4cUxeGkcC9jpvoYriLI0bY8DOgWZfi6u
----- REACT TUTORIALS
https://www.youtube.com/playlist?list=PL4cUxeGkcC9i0_2FF-WhtRIfIJ1lXlTZR
----- SUBSCRIBE TO CHANNEL - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1
======== Social Links ==========
Twitter - @TheNetNinja - https://twitter.com/thenetninjauk
Patreon - https://www.patreon.com/thenetninja
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 25 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
▶
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: API Design
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Applying Scalability in Backend (CodeBuddy)
Medium · LLM
Why Every Backend Developer Should Learn Nginx Before Going to Production
Medium · DevOps
Connecting Frontend to Backend: A Backend Engineer’s Reality Check
Medium · Programming
Build Secure Authentication System Using Access and Refresh Tokens
Medium · Python
🎓
Tutor Explanation
DeepCamp AI