GraphQL Tutorial #24 - Book List Component
Skills:
React80%
Key Takeaways
Creates a Book List component in React for a GraphQL application
Full Transcript
alright then so at the minute our react app is looking a bit like this very simple and it's just one component at the minute the root component so now what I'd like to do is introduce another component which is going to be responsible for listing our books on the page so let's head back to the code and create this component first of all I'm going to right click source and create a new folder called components which is where all of our component files will live and then inside there let's create a new file and I'm going to call this book list so capital B capital L is alright so we have now this book list component file and what I'm going to do is just grab all of this here and I'm going to paste it inside here because the general structure the boilerplate of a component is going to be more or less the same right so what we're going to do now is change this thing here to book list all right and then we'll change this export down here it's book list and now we have this component right so this component is going to be a div first of all and then underneath or rather within that diff we're going to have a ul and the ID of this ul is going to be book - list all right so inside this ul we're just gonna for now output one Li tag right eventually what we'll do is dynamically output several Li tags here depending on how much data we have but for now since we're not actually querying any data and we don't have any data to output we're just going to do one little Li tag so book name or something like that right so close the Li tag and save it so now we've created this book list component very simple and what we want to do is render it on the page so to do that we're going to nest it inside the app KS file right here right we want to nest it down here somewhere so the first thing we need to do is import that book list component so down here I'm going to create a little comment saying components like so and these are going to be the components that we import and nest into this route component so to do that I'll say import book list from and it's gonna be the correct directory forward slash into the components folder forward slash book list like so okay so we've imported that component now so therefore we can render it anywhere inside this component so I'm going to do it underneath the h1 and the way that we do this the way we nest another component is by opening our tags and then putting out the name of the component which we just imported then self closing tag so this was the name book list and we've just added it into a tag right there so react is going to look at this say okay well I want to render now the book list component under the h1 so it's going to grab that component and it's gonna render all of this underneath that h1 alright so let's just make sure this has worked I'm going to save everything and then head over to the front-end and we can see now we have book name right here alright so now we've created our route component and we've also created our workbook list component so I think in the next lesson we can start to set up Apollo on the front end the Apollo clients so that we can start interacting with our graph to our server making queries receiving data so we can finally start outputting data on the front end
Original Description
Hey gang, in this GraphQL tutorial we'll create the backbone of our Book List component, and est it in our root App component.
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 · 27 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
25
26
▶
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: React
View skill →Related Reads
📰
📰
📰
📰
Why Every Developer Should Learn Backend (Even If You Love AI or Frontend)
Medium · AI
7 Apache Kafka Design Patterns Every Backend Engineer Should Know
Medium · Programming
Symfony Validator: Where Framework Validation Ends, Domain Rules Begin
Dev.to · Gabriel Anhaia
Seu status de pedido não devia ser uma string
Dev.to · Denis Augusto
🎓
Tutor Explanation
DeepCamp AI