An Introduction to #GraphQL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] [Music] [Music] [Applause] [Music] all right hello and welcome everybody to our intro to graphql workshop we'll get started here in a minute but first let's start with a nice fun music video [Music] [Applause] [Music] [Applause] [Music] atm tools keep me up all night stargate will help [Music] all right and hello everybody and welcome to our introduction to graphql workshop i am david jones gilardi joined today by kirsten hunter hello kirsten hey how's everybody going hopefully we're doing all right now so if we can get a sound check give us a thumbs up if you can hear us and you can see us that'll be good to know awesome cedric thank you and thank you rags i see that and of course uh barbara you know thank you for the workshop series thank you for coming we appreciate that all right awesome great i see a bunch of thumbs up sounds like you can hear us loud and clear with that let's go ahead and get into some content and get started today because as usual we have a ton of things to go through with you so it is not just myself and kirsten uh with us today we have a whole host you know for those of you who have joined us before you might notice this this page keeps getting bigger and bigger and bigger right um so we have added some new folks more advocates to the team more team members so we have a whole host of people that are supporting in the chat and everything like that it's not just myself and kirsten um and the point of us really telling you that is this is meant to be interactive right um we're all learning here and this intro to graphql ask your questions don't be shy we'll do our best to get to everything from that standpoint okay so just a couple housekeeping items um one since the question always gets asked and usually asked a lot yes this stream is in fact being recorded so if any point if you need to leave or something you can always come back and just replay it or something it isn't the same link you're watching now right so if you're watching the stream then this is the one you come back to to watch the recording later up in the top right hand corner you may notice discord so while we have the youtube chat and the youtube chat is great and all that the vast majority of you are there um it doesn't offer some of the nice features that discord does like one persistence so once the session ends the chat will stop but if you want to continue conversation let's say you're doing some of the homework and you have a question or something like that join our discord server as a matter of fact um ryan let's see i believe nightbot if i say bang discord it should give you the link to our discord server right so it'll drop that and if any point you also want to get the link the discord or something like that just do bang discord and you will menti yeah i believe bang menti is also a thing and i'm going to talk about that here in just a moment um so you'll notice there on the bottom mente.com so that is the tool that we use we're going to ask you a couple questions in the beginning but then we're going to have a swag quiz at the end so if you stick with us to the end we'll do a swag quiz we'll test your knowledge and if you're actually listening hopefully i don't put you to sleep today um and then you can you can play so we'll do that here in a moment okay a little bit more in the housekeeping some of the tools that we're gonna use today if you're not familiar with github um that is a version control source uh tool up in the web you know it's actually between github and git lab i think it's got pretty much everyone covered when it comes to using git um so github is the repository that we're going to use today we'll share that with you again if you do bang github in the chat it'll actually give you the link as well um so everything we do today in this workshop will be in the github repo the slides the exercises everything you need is there all the tools that we're going to use today are up in the cloud we're going to provide you with everything now one thing i would like to mention um even though we do provide uh all of the code and stuff like that up on git pod and it's a cloud-based ide by the way all that is free if you want to do this on your own machine there's no reason why you can't just know that is considered a more advanced path where with gitpod and everything we have pre-configured pretty much everything to get it going for you um so so i would really suggest that if you're intending to follow along with us today that you do with us in getpod because that's going to be the path that we're all going to go with but again if you want to do it locally there's no reason you can't it's just really more advanced then finally at the bottom you'll see the astra db uh tools so as part of this workshop we're not only going to talk about you know like what is graphql and get into that and such like that but we're also going to do some experimenting we're going to experiment with um a graphql server that is implemented in java using the netflix dgs framework uh we're also going to have stuff on the front end with react.js where we then you know essentially uh digesting you know it adjusting all of that server side stuff into our front end where we can then see it rendered and all that we're also though going to hook up to an actual database a data layer with astrodb also using graphql right we're going to do all that today so these are the tools that you should be aware of and again everything that we do is free if you've never been with us before all the tools there's nothing that you'll ever have to pay for you may have to register for something but that'll be it okay now i saw this question coming up a couple times is there a certificate for this workshop there is no certificate for attending the workshop however if you would like to earn a nice badge one that you can put in like your linkedin featured section and such like that then what you can do is not only attend today like you're doing but then complete the homework and we have detailed what the homework is in the repo i will point it out later and as long as you complete that homework you submit it and all the instructions you need to do that are actually in the repo then you can earn yourself a nice little badge it looks like this the graphql workshop one and like i said then you can use that for bragging rights so again there is no certificate but there is a badge that you in fact can earn for attending today and doing the homework all right um mega says what what are the prerequisites to attend the workshop you know i would say in this case from a tools perspective none because we're going to provide everything for you from that standpoint from a knowledge standpoint having a little knowledge of how react works is probably not such a bad thing is it absolutely needed no um i will try to do my best and same with kirsten to kind of explain some of the various pieces but we're not going to be getting like deep into react or anything um if if you are someone though who's like hey i've never done react before say something in the chat because we have resources for you right we actually have um other workshops that you can go through that'll bring you through that experience but i would say if anything you know a little bit of experience in react would probably help but it's not absolutely needed all right so oh yeah go ahead okay you were just yeah all right so let's go to mendy.com all right this is where i'm going to ask you some questions so notice you should have a code on your screen a qr code that you can scan with your phone or uh if you have the code there as a matter of fact let's go bang menti in the chat i see our mohan not worked on react okay um a lot of people who haven't worked with react okay well then you know what we'll do is oh thank you ryan just dropped the react workshop ryan can you also drop that into discord we have other people um who uh who have not worked in rec there um naveen my db is in standby mode how can i move it back you don't need to you just need to start interacting with it again it'll kick on by itself um this emit this is from the graphql standpoint yes this is for beginners um like i was mentioning a moment ago from the code standpoint it you know it would help if you have some understanding of things like rec but if you don't that's totally okay okay all right let's see how we're doing on the mentee oh my box is going to be laggy today fun laggy box laggy box i'm stuck on this screen uh oh let's see oh go to mentee.com yeah not meant to meet her mentee.com i'm actually stuck on this screen my there we go let me uh see if mentee will free me come on mentee let me let me do it it's not responding all right here you're seeing fourth wall give me a second here minty has decided that it does not want to allow me to do that screen again so now absolutely uh react is not necessary at all it's just a type of an api so yeah that's right it's document uh it's not necessary but that's how we're showing it to you today exactly thank you kirsten all right so i got back to the menu screen let's go into the questions they're kind of locked up for me or on me all right so i saw a bunch of you were in awesome so first question i have for you is how much experience do you have with graphql okay we have some folks have used a little bit oh we have a graphql master who's jumped in i wonder if there's like one person all right it looks like the vast majority of folks have either never heard about it or they maybe know the concepts right some folks that use it here and there so um you um dextrose we are going to talk about what graphql is here really soon all right thank you for answering that let's go to our next question so which apis are you developing and you can pick multiple and we i recognize this isn't all the apis in the world and stuff but kind of the main ones yeah a lot of restful right always folks have restful i always love the soap web services help me honestly i i used to really enjoy soap back in the day it was such a it was so nice so much nicer than what we had before god at the time it's so funny how every time we have a new bit of technology it makes the other one that we had just looked like terrible like we were what we were how barbaric were we in the years prior so we have a good amount of folks kirsten who are in fact using graphql apis that's wonderful a lot of rest well guess what for you restful folks a lot of the comparisons that we're going to use today are are actually going to be between graphql and rust so that's actually good because hopefully a lot of you who are already familiar with rest you'll start to see some of the pros and cons of graphql right there's there's benefits back and forth really restful is life nice adventure house all right so thank you everybody i appreciate you answering those questions leave this window open because we're going to come back to it and we're going to get back for the um get back to it for the swag quiz uh harshada if you're unable to find the menti code in the chat i'll do it now do bang menti and bang is an exclamation point and that should give you the link to that but we're going to move away from mentee now and get into some of the content okay so basic agenda what are we doing right now the first thing i'm actually going to do in just a moment if for those of you who are especially wondering what graphql is i'm going to just briefly kind of give the y what is graphql why is it cool right and then we're actually gonna go right into our db setup and credentials and really what we're doing here is we kind of have a whole system for you set up between the database uh front end app a back end app and everything we need to launch our ide and kind of get the environment going and that's going to take a moment to bake right it's going to bake for a moment so we're going to start with that get it all up and going then we're going to move over into the introduction to graphql design we'll actually start talking about that while that stuff is baking and then by the time that's done we can get into the graphql tooling and the back end and such like that so we'll look at some of the tools some of the graphql ides that you can use to explore your schemas and query and mutate and such like that we'll briefly look at a very simple back end that exposes a gql endpoint that was created by with the netflix dgs framework so netflix actually has a really awesome graphql back-end framework that they give you full tutorials spring initializer and stuff on and as a matter of fact the app that we have is actually a basic version of that really then we'll move in to then consume the graphql endpoint that we've created not only from the java end but then also from the database as well and that's where we'll be doing that in react.js and then finally we'll finish up with some resources alrighty so let me just really quickly i want to give you an idea of the types of things that you're going to be doing and what you're going to see so hopefully you can see my screen let me know i've tried to um i tried to already kind of pre-zoom in for everybody let me know if you need to be good the code is still a little small yeah you know i can zoom this in a little bit unfortunately it starts taking up all my screen real estate but yeah i can i'll i'm trying to make this better now don't forget that we are all going to do this together um so you're going to see this as well i just wanted to give you an idea of some of the things to expect so on the left hand side here here's our react app um notice and and again you haven't you haven't actually stood this up yet you're going to here soon but all i really want to point out here is that i have a set of really react components that are spitting out these sections like shows local genres local um we have this shows my name with the astrodb and astrodb in an on purpose error that we'll talk about later um really this is the end result right this is consuming our graphedql endpoints and then injecting the results dynamically into the dom with react.js right so this is at the end of things something similar to what you should see from that standpoint on the right hand side you can see we have our graphical ide so this is one of the graphql ides that we're going to use today and here are actually some graphql queries i'll break them down a little bit later we'll talk about them and everything but then you can use a tool like this to explore your graphql schema the data in your endpoint and you know perform queries and such um so this is one of the tools that when you launch your ide and everything this will come up um on the bottom here it's not as important that you actually read the text this is actually the java back end running um so you'll notice every time i perform a query you can just see that it's spitting out some very very simple logs um that is just to kind of give that you know connection if you will like okay i did the query it hit the back end oh i saw the back end do something right that that's all that's really there um so this is the general setup that you'll have and then of course we'll have the database piece and everything but i want to give everybody kind of just a feel for what that looks like so you know what to expect coming up okay all right let's pop back over powerland questions kirsten let's see um we're okay although savannah is kind of pointing someone to a graphql playground which is not what we're using uh so it won't have the things uh set up uh that we have set up in yeah and interestingly that's a possibility but we're not gonna be able to support them on that path no i will tell you severna if you are an advanced enough graph graphql user that you know how to hook up your own um graphql ide through the graphql endpoints that we have have at it right um that that's actually really awesome um we will in fact be using the graphql playground when we get to the astrodb section because that does in fact have the playground embedded um i believe if you're calling it the graphql playground i believe it's the same one so we'll see um let's see um arshada how should this setup be done by us so in a moment once we get through a couple slides we're going to start spinning up the environment um what's going to happen is i've pre-baked pretty much everything in get pod yaml if you take a look at the getpod yemo that's one way if you're trying to if you want to do this yourself locally you can see the kind of resources you need i'll make sure to point that out when we go to do it um and um this is all online right we have provided everything up for you on the cloud so you don't actually have to download anything and yes grav we will be doing some mutations right we'll be doing some queries and mutations okay all right with that so let's just talk a little bit about graphql itself and what it is where did it come from um so cool enough graphql actually was initially created by facebook so many years back and they had originally used it for their mobile apps now one of the things that you're going to find out about graphql and one of the things that makes it cool this is one of the reasons why it's cool is because it gives you explicit control over the fields and the payload that as a consumer on your client that you get back all right if you compare that to something like a rest endpoint or whatever you'll access that rest endpoint and then you're going to get the payload back even if i'm going to be absurd here for a moment even if you had a thousand columns of data you're gonna get that whole payload back but in graphql if you have a thousand columns of data you can specify just two and you only get back exactly what it is you ask for and the reason why this is important for mobile apps especially back in 2012 right it's just bandwidth when it comes down to it you don't have the same kind of bandwidth requirements on a mobile device that you might have on a desktop app or a web app or something like that so facebook that that was one of the reasons why they had created it um was to really optimize the experience for mobile in the mobile experience by significantly decreasing the amount of network bandwidth and such that was needed um so graphql has baked in a lot of flexibility that you'll you'll see um eventually what it comes down to is they open sourced it interestingly enough by the way facebook was the als also the company originally behind cassandra um which is what astrodb is built on um so we'll talk about that a little bit later but hey kudos to facebook for open sourcing really cool stuff um so you know facebook open source is it github announces a move to gkl um there are actually uh netflix is a big graphql user um there are a ton of folks out there even though graphql is still somewhat new right it's it's gotten a pretty good amount of adoption and it's very flexible and neat um so overall graphql as you can see there on the right hand side it's an api right so if you're used to a rest or grpc or soap or you know websites or any of those are apis right there are ways that our applications can talk to other services whether they're other applications or their backend databases or something like that graphql is no different from that standpoint it's another api right um now provides though both front-end query language you know services and then server-side runtime piece so you and we're going to explore both of those today that's exactly why if you're curious like why why did you mention java and react.js that's exactly why so we'll see some ex some examples of both okay oh yeah um savario if you want the git pod link or if anybody wants a github link in the youtube chat do bang get pod i'm gonna do it right now there it goes and that will drop you the link uh and you can go right to the repo and i do wanna do a heads up here i see some people who are like well i could just use vs code on my own system and yes you can yeah but that is not the path that we are covering here so if you run into something that doesn't work because you don't have the environment that we created for the gitpod repository um you're gonna have to figure that one out yourself so yeah and if you are like by the way i'm also using vs code on my own system um yeah and it's totally fine but to kirsten's point and you'll see that when we launch git pod we've pre-configured a lot of things with you for you the reason why we have we're using spring boot with java on one side we're using you know netlify actually on the other with serverless functions if you're not familiar with those things it's not that hard to set up but it's much easier if we just launch you up and get pods so yes you can totally do this on your own it just might you know take a little bit more work okay so why graphql then now i started talking about that a little bit um a little bit a moment ago with the why of where you know facebook came up with graphql and everything like that but you know what is it what is it that graphql really provides the first thing on the left-hand side you see that describe your data right so you can explicitly define what your graphql schema is going to be um and what's cool about this if you look at that example you see where it has you know i'm so i'm going to say maybe i want to have some type right this is going to be something that maybe i'd be querying against in graphql called project and within that type of project i have fields and this would be a way that i would define the schema for my project type and i'm just saying hey it's got these three fields named tagline contributors then and i see your question rajiv can't we control the response fields and and rest also by specifying you know you can um to some degree however rajiv to to the rest piece you have to do a lot more work to do it where it's kind of natural and graphql to be able to do it so there are there are there's some balancing act here totally um then based off that schema on when you're consuming graphql at the query or even at the mutation or something like that then you can just specify exactly which field you want right and that is basically you know that is that's a direct line to whatever has been defined in its schema are exactly the fields that you can get um and not only that graphql is strongly typed right and it also means this really translates into you get predictable results you only get back exactly the fields that you request and because it is strongly typed you know exactly what types of fields that you are getting okay so then is the astrodb part so where does this come into play right so as i mentioned we're going to use the java back end with the netflix ggs framework as a simple example of a graphql server side backend but then we're also going to use a real database that's also powered by graphql and that's where astrodb comes in so there is a there is a layer in astra called stargate that is actually open source stargate.io is open source and it provides a whole set of ubiquitous apis like graphql rest grpc you know things like that um on top of apache sandra is really what it was or what it is and we're going to use the graphql portion and the graphql playground of that today so when we power up our database then we'll be hooking right into the graphql endpoint um that you get via stargate and astra um so that's what we're going to do now we're going to go ahead we're going to go ahead we're going to create our astro debate database we're then going to create an authentication token right because this is a cloud-based service and then that is going to give us access to this and then once we have that we'll spin up our git pod we'll start going with some of the code and everything uh and we'll hook things up all righty all right with that let's see let's see how are we doing on questions kirsten it looks like we have a lot of people trying to jump ahead okay uh so i mean that's fine but um we're going to try to focus the the comments in the youtube on uh what's actually happening right now okay okay okay so what i'd like you to do now if you're gonna follow along i'm gonna do this with you but if you're gonna follow along um then let's go ahead thank you nightbot uh that's the gitpod one [Music] oh that's a different one i want github github there we go i'm gonna drop the nightbot link again if you want the link to the repo uh i will drop you you'd say bang github and there it goes and then for those of you in discord i have not forgotten you i will go ahead and get that to you as well here is the github there you go all right so again if you're going to follow along this is where you want to go okay all right so hopefully you see my screen and i'm in the repo here on the left hand side now these repos are built to be completely self-service and what i mean by that is there's a lot of extra stuff text and things that are in there then i'm i'm going to pretty much skip skip on because i'm talking to it right i'm not going to just read all the text or anything like that but i'm going to go through the various steps if you want to go back at any time and do this completely on your own this is actually by the way this is part of the homework right so for those of you who want to earn badges this is this is part of the homework but you can always go back and do this on your own i do want to just point out a couple things that all of the resources that have been used for all of this i've tried really hard to make sure that they're all linked here and i have a resources section as well so for those of you who are say interested in using the netflix dgs framework for a graphql server back end that's there if you're interested in you know um you know doing stuff on the react end that's there so on and so forth the last thing i want to say about the the beginning part of the repo here is right here so this is kind of a companion uh to our netflix clone we have a netflix clone workshop that uses graphql to create a very very simple netflix clone a lot of the what actually kind of happened is a lot of people in that workshop weren't familiar with graphql um so we essentially devised this workshop as being like a prologue to that if you will um so once you're done with this if you want to then go try your hand at building the netflix clone um then that is the link that you see here so i i do want to call out um uh cql is is not what we're covering here uh there's lots of uh courses we have on introduce sandra and using astra but um we're not really covering cql here we're we're covering the graphql interface yeah i mean ask your questions and actually that's a great time to go to the discord channel right so if you have follow-up questions or things that maybe are kind of a little bit out of the scope of the stuff go to the discord channel ask us on discord and we're more more than happy to answer all right so here's what i'm gonna do um just a couple things by the way for those of you who are asking about hey can't i do this in my own vs code we do have a faq and in the faq it says hey can i run this on my local computer yes you can we'll tell you things like hey you need node 15 you need npm seven um we'll use the netflip cli again if you're following along for what we do in gitpod you don't need to worry about that that's just really for the people doing it um locally like i said it's it's more advanced um everything we're going to do is free i just want to make sure that's very clear you will need a github account uh because to use gitpod you will need to have a github account from that standpoint uh and just a couple other things just to point out is the slide deck and everything all the detail we get in there that's all here um the homework section this is what i was mentioning before here are the instructions for it you see this link at step four you just click that it'll submit an issue you just fill it out uh and that's all you need to do and then all of these resources right that's what i was talking about um i tried to explain these as best as possible so you kind of know what they are um there are some really cool resources here especially if you're looking for graphql ides um a really awesome video by ali spittle for graphql starters you know there's actually a ton of information out there in graphql uh so there's there's plenty to digest for sure alrighty um anker astrodb does not need to be set up on local it's actually all cloud-based everything we're going to do today is completely cloud-based all right so what i'd like you to do is follow me here to step one log in or register to astrodb and create database so what you'll see this big orange crate astrodb button right here now for all of the buttons and links that are in github markdown they don't allow target blank so that means they won't automatically launch into another browser tab so what i suggest is either right click say open a new tab middle click control click however you want to do it just kind of get used to doing it that way so it doesn't just launch in the tab you're currently in now if you've never been to astr before you'll be asked to register again that is completely free you can use your github account you can use a google account you can just put in your own kind of authentication if you want that's totally up to you i've already obviously logged in before so i'm going to go ahead and do this and then you should once you log in i'll give you ever i'll give you all a minute to get registered and stuff like that if you haven't done it before once you log in you should get to a screen that looks something like this right you'll see these create database buttons and such now i have a bunch of databases because i do stuff in here all the time but you probably won't if you're brand new so what you'll want to do once you get to the screen is create database i'll click on this and once you do that you should get to a screen that looks like this so what i'd like you to do is if you've gotten here give us a thumbs up in the chats let us know that you've gotten here and by the way don't you don't have to wait for me i'm just going to start filling stuff out and talking i just want to get a sense you know for the registration and stuff if if everyone's getting to where they need to be oh hey orlando how you doing awesome thank you of course you have one you've been with us before all right so so you'll notice as we go down through the instructions in step 1a i'm actually going to give you the database name and the key space right that's these fields here database name and key space i'm going to fill out the database name and the key space and if you're curious what the key space is the key space is just the container of tables right um so if you're coming from the relational world database a relational database world that'll be like a schema or a database in that world that's our that's what cassandra calls it is a key space so we want to use the values here by the way why because all the stuff in the workshop is using these values right so if you deviate away from this then things aren't going to work right in your own databases when you're experimenting on your own you could do whatever you want but i asked that today you use these values then in the provider and region section right you can choose any of these cloud providers there is no hidden cost here or anything like that you can just i'll just choose google cloud today we handle this all in the background as part of astra so you don't need an account with them or anything and this is partially about flexibility so you can choose whatever provider you want we actually just released a new multi-region feature that allows you to span data centers over multiple regions that's totally out of scope but today but i was just saying that it's there but all you really need to do here is pick a provider it doesn't matter which one pick an area close to you i'm in north america so i'm gonna do that i'm closest to virginia so i'll do that and then create database will light up and hit the button yeah manny there might be some similarities from that standpoint but it's it's that's not intended for sure then once you have once you've created the database you should see something that looks like this it'll say pending or initializing that's totally fine you can move on right um so you want to get to this part let's see and again let's see pending or initializing how are we doing on the stream and everything like that are we looking good i saw bernard say what happens i was hoping my screens didn't die no it looks okay to me i think we're good it looks pretty clear um so um and and the questions are are moving on from getting set up so i think we're good yeah pdr uh pwr pro you shouldn't have to worry about credits or anything like that maybe you can give a little bit more detail or follow up or reach out on discord do the bang discord um and and and get some help there adventure house yes you can totally use your previous token if you've been with us before you've created a security token you can absolutely do that pwr pro i think you have five databases already you can only have five so um you can have as many key spaces as you want in a database but uh individual databases you can only have five at this point all right so hopefully you were at a point where again you have a pending or initializing database it could also already be active once you're there the next thing we want to do is now go to create a security token token step two right now this is really important uh because and these are this is a cloud-based database right so it's publicly available you don't want to just have it wide open to everybody you need an authentication token um this is actually how all the major cloud providers everybody does it this way by the way notice that in any of these sections there's this little show me drop downs they're nice little animated gifs that kind of show you how to do things as well so what you can do there's two ways that you can get your token one you can click the little ellipsis on the right hand side and go to generate a token that is my preferred way to do it and again notice i middle-clicked or you can say open link in a new tab we want to i want to save this for later so i just open a new tab another way you can do it is up on the top left hand corner you can click the drop down go to organization settings again i'm just going to put it in a new tab oh there it goes i was being lazy okay and what what that'll happen is so if i went to the one from the ellipsis it goes right to the token management section if i use uh the drop down like i did a second ago right that drop down um it will then go to it'll get to the same page and you'll see the the token management page but what you want to do is you want to click on either it goes to token manager but you just click on token management either one doesn't matter once you're here on this page you want to select a role in this case your role will be database administrator and then say generate token now here's something important about this when you get this token you only ever get it once you will never be able to get it again for security reasons so it is important that you download the token details that way as adventure house was just asking you can use it later because then you can use that for communication with the database um now the reason why i put this in another tab is because there's a nice little copy widget right here i'm going to use this later so i'm just going to leave this up but again if you're doing this download the token details that way if you ever navigate away from this page you don't lose your token okay and don't fret because if you go away from this page and you lose your token and you didn't download it um it's okay you can just make a new token all right you can see that that david has a lot of time i have plenty yes these tokens so if you get stuck and and you lose track of where your token is it's cool just come make another one exactly thank you and uh so thomas um after hitting create database it's still stuck loading that's fine it might take a couple minutes we're actually you even though we don't really focus on the astrodb part you're actually spinning up a fully fledged cassandra cluster when you click that button so it might take a couple of minutes it's totally fine we can move on to everything we're doing right now um and then i saw another question from major league uh how do we see the step-by-step directions in the youtube chat there dude bang i'm gonna do it for you do bang github and that right there you should see it the nightbot will drop you a link that'll bring you to the repo that i'm working off of so it sounds like we're going a little too fast yeah i was gonna repeat the token yeah so um if everybody could just drop like if you're stuck on a on a piece could you just could you just drop a note for us so we know which parts to go over again um we're happy to uh go through those step-by-step instructions and make sure you have what you need but we need to know where you're where you're getting uh caught up yep and mark little um i will the role for the token is database administrator and yes uh minjit i'm going to repeat how to do the token and the database part i'm going to repeat all of that we usually do those twice for you so from the database standpoint when you first register for astra you should come to a dashboard that looks very similar to this and have a create database button like i see here right so you'll want to click that button and then we give you the under step 1a here we tell you what the database name and keyspace name are you fill those out like that pick a region doesn't matter it doesn't matter what provider or region at all there's no hidden cost or anything that is just part about astroworks you don't need accounts um it just gives you flexibility pick a region that is close to you pick a region like this i'm in the east so i'll pick one close to me you'll see create database and then hit that button that's it that's all you need to do from the database standpoint okay and then again once you've done that you'll see you'll see the database go appending or initialize or something like that now for those of you asking about the token how do i get to the token creation screen there's two ways to do it the preferred way is if you go to if you look at your you should have at least one database at this point right and if you go to your database on the very very right hand side you should have this ellipsis and if i click that i say generate a token that'll bring me right to the generate a token page that's where i i was doing this earlier or you can go to the organization drop down here on the left click that drop down say organization settings and then once you load that go to the token management section and then here you choose database administrator and generate token hopefully for those who are asking that gave you what you need there awesome thank you armahan cool all right i see so um one of the things that we haven't really covered here that i think might be helpful is to understand that these tokens are at the organization level so you you your account is like an organization so if you have five different databases with 62 different key spaces each you can use the same token on all of those databases so don't think of it as i have to get a token for this particular database base if you've made an organization database administrator token it'll work for all your databases yes yes exactly thank you kirsten yeah and i saw i did see somebody ask i think that was uh tosith who's asking hey i've already done another tutorial i've got a token you can create as many tokens as you want as kirsten was saying um and you could for that one token you can totally reuse that for your apps now i will say this though from a best practices standpoint if you have multiple applications you are using it's a best practice to create a token for each of them that way from a tracking standpoint if you have to delete a token for some reason you don't like wipe out access to all your apps right so it's a better idea to have a token per app but you don't technically need to do that so as as it says on the instructions you just want the token the client id and the client secret are not used for this so yeah yeah we'll we'll get to that later exactly but yeah we're only going to worry about the token part today but we will talk about that when we get to it um and let's see so tokens are not the tokens are not specific to a key space as as kirsten said they're specific to your org so let's say like in my case i created all these databases one token could in fact work for all of them right it's not key space specific or anything like that uh kirsten i'm sorry what were you going to say um i was going to say um the astra is it's not a fork of cassandra it is cassandra as a service we're running cassandra in the back end and we're providing for you the hosting of that of that service so it means it's managed by us uh one of the things that's kind of challenging about cassandra is that the management can be overwhelming so we do that we take care of that for you yeah and each it's just it's just a a service yeah and and h a key space is just the container of tables right it's just like a database or a schema from the relational database world it's just the container of tables so the key space that we create today this one that is called um netflix key space that is where we're going to contain all the tables that we're working with for our app and that domain of the netflix key space okay if you don't see the astra cs tokens uh unless you are on the the um page where you created them or if you downloaded them with csv they do not show up in the token management section only when they are created can you get that token information so if you don't have that anywhere you're going to create a new token and use that astra cs token okay so anker and cigar and discord i see your questions i am not uh ignoring you i'm going to get to them in a moment i want to get everybody on get pod all right so if you've gotten to the point where you've created your database no matter what status it's in and you've created your token the next thing i want you to do is open in gitpod so again i'm going to right click say open a new tab now this is the fun part it's going to start spinning up all of this environment so the java back end the react.js front end uh the graphical piece you know basic graphql server all that so we're gonna let this bake so i'd like you to if you've gotten to the opening git pod spot you've gotten to this where you're loading it gives thumbs up let us know you're here because then after that i am going to move into some of the graphql content let's see correct uh uh oh oh i i've asked you how to pronounce your name before in a previous thing dudesby and now i'm gonna say it wrong but it said on generating a new token that means there's no need to update our app which uses the old token correct when you generate a new token it doesn't invalidate your previous tokens that only happens if you explicitly delete a token right so your old tokens are valid yes all right so i'm just going to move a couple things around you can see a bunch of stuff going on npm is going to download the world channel you just need to get to the github repository that's where the button is for launching gitpod okay uh ankur why database administrator because i was being a little lazy could i've used a read write token or something yes um you know but i'll just be a little lazy um cigar can we go we like to use that one um uh because when we do set up things it makes it possible for us it does make it easier it's easier for our workshops yeah that's what i meant by i was being lazy um so cigar can we make a legacy system work on graphql i don't see why not honestly um you know obviously just like any change in api you will need to then change your legacy code in order to talk to the api but i don't see why not um does gambon still only like chrome and firefox i don't think we mentioned that oh we don't need to do that here yeah this is not a referral link it should work in safari and brave as well um yeah and then uh cigar also asks how can we set up the graphql server we're gonna do that here in a moment yeah yeah matter of fact um um oh make sure in your dash make sure you're logged in if you get when you go to launch gitpod if you get an unauthorized you need to be logged into github right make sure you're logged into github to launch kpop all righty yes npm is going to download the world because that is what npm does yes we love npm but it is download the world okay so let's let that bake we're going to let that do its thing we need to zoom i'll do that when i come back yeah okay yeah no you're right i do have to totally zoom in i want everybody to bake there i saw a bunch of thumbs up so great now we have the environment all baking um oh great nerdesh yes that means wonderful now let's go ahead and take a moment and go through some of the um uh some of the the actual graphql content uh oh and by the way how do you change the dark mode it's a setting it's in uh in the vs code up in gitpod um there is a hamburger menu to the top left you click on that i'm trying to remember where it is it's easy to find but there is a setting in there where you can change dark mode all right how are we doing any questions kirsten anything we need to get to before we move on um no they're they're they're uh they're excited to do uh another thing actual stuff let's do the stuff they're anxious so all right let's uh let's let's make sure everybody opened get pod though can you uh get a thumbs up from everybody to make sure that they have their get pot up and running and and uh they're ready to go yeah i did ask that for that a couple minutes ago i did see a bunch of thumbs up i think we're still seeing some come in yeah okay okay wonderful thank you get going what uh uh bharat you're not able to log in to github probably github yeah okay yeah make sure again make sure to log in it's not get lab it's github yeah yeah make sure to log into github in order for the get pod to work and i see you dandelion you're good yeah no worries no worries okay all right so while that's going let's go ahead and we'll get into some of the what and why and stuff like that behind graphql while those things bake so we have enough time for you to do the rest of the stuff so the first thing a little bit more about the what is uh graphql right so it is an essentially it's another web protocol over http similar to like rest would be because we have so many rust folks in here today um the the difference about graphql is the way that you build your schemas and that you query data right um and it uses a tree in json syntax so especially for those of you who are front-end folks you should be very familiar with jason this should feel you know very very familiar right and you can see kind of an example of that here on the right-hand side now it is strongly tight right that's actually really important so you'll find that when you define you know again funny enough um in in javascript unless you're using typescript right or if you're a java person i'm a primary java person i'm used to a strongly typed language but some languages like javascript aren't and you know that can offer flexibility in one way but then it can you know kind of cause problems in another the key thing though with graphql is that in fact is strongly typed so you are guaranteed that when a particular field is set to a type then you know exactly what that type you know what to expect um so it is a strongly typed uh schema and language here we go um as i mentioned a little bit earlier that graphql allows the client to specify exactly what data it needs from a model um going back to my absurd example imagine incoming workshop let's say this type let's say that a thousand fields i don't need to get all a thousand of those back in my payload i can just specify exactly what i need like this case where i'm just pulling title and i can do that at the client what's really cool about it too is that i don't really have a bunch of different endpoints i don't have to track which endpoints or anything i need to get what data i can just use that single graphql endpoint and then i can change you know whatever the fields are and stuff and get the data that i want it also allows you this is actually kind of a really neat feature you can aggregate multiple relations in a single query so imagine for a second that i actually had two different sources that i wanted to get data from and something like rest chances are unless i had a custom rest endpoint that was made to do that one specific thing i would have to i'd have to request data from one rest endpoint and another rest endpoint and then i'd have to put that data together in my app somehow in graphql i can actually nest this stuff into a single into a single object in a single query and so i i make one request right one network request and then i can get all of that data and we're going to show an example of that a little bit later you can even go so far to do joints right so not only can you aggregate data from multiple sources but then you can actually do joins between them um so there's a lot of power here um in the language now as i mentioned it's a strongly typed system um so you will find that there are all sorts of types that generally if you're coding you're going to be familiar with things like ins and floats booleans uh so on and so forth right you can also even define your own user defined types and such um so it's pretty darn flexible from that standpoint this is not obviously an exhaustive list or anything but it gives you an idea of um you know the the types that are there um and by the way just kind of a note of something i've come across before that they have a ton of built-in scalar types and even though you can make your own custom types it's better to use always the default scalers that are there first unless you have to do something particularly special all right so now from a schema definition standpoint so this is where and we'll experiment with this a little bit on the java end of it um so here on the right-hand side is an example of defining our schema right so this is something i would actually specify in a schema file notice what i'm saying here is i have some type i define these so my type query and for a type query let's say i'm going to look for a hero right now here's what i want to point out this is something cool that graphql does notice what this is pointing to it's not just saying that it's a string or an int it's not just using a scalar it's actually referencing character so what's cool about graphql is that you can reference other types you can reference other objects in there so what's actually going to happen is my query then the hero field will actually reference the character type and then look oh we're building the character type and now i've got you know a name for my character i have friends oh look that's an array right i have an array of characters i can self-reference right so notice that i'm referencing the very type that we're creating um you know so you can you it's a definitely a little bit more complex model for sure but this this ability to be able to reference other types in your schema is actually really powerful and you'll see some examples where this comes into play and again another example of this i have a homeward field that i'm then referencing with the planet type oh look i've got a planet type down here and i define its parameters so on and so forth now how does that translate into what the query looks like right so if we take a look here on the left hand side let's say i want to query by something like this i want to get a hero well remember a hero is in fact a character and a character has a set these fields here so notice that the fields that i have here things like name they have to coincide exactly right and one of the cool powers of graphql we'll get into this part a little bit later is there's an ability here like there's validation there's a validation layer in graphql that will not allow you to query outside of fields and types and stuff that don't exist in your schema so whatever is defined here this is exactly what you can query from and what's cool is you can introspect and you can look into that schema without executing queries first actually a lot of the ides they do that for you you'll see that a little bit today we're going to play with that um so they do that part for you and you can use that to explore what the schema is well before you even execute your first query right but really what i want to point out is that these fields match exactly notice friends right again this is a character so in character friends is a string of characters i'm sorry an array of characters i said that weird you say i have my friends here then and since those are characters they also have names they have homeworlds right a homeworld is a planet which has a name and a climate you can see this kind of nested structure right so one thing to kind of point out about it is that compared to like rest graphql is more complex no doubt but it offers up a ton of flexibility so once you get used to kind of the feel of kind of how you you know how you query and how you chain down things the flexibility that's there is really awesome but yes it is a little bit more complex than what we'd expect with a rest endpoint okay okay so if we then take a look at a graphql query what's a query so a query is what you're going to use to query data and perform read-only requests right that's a key thing here so the query is the actual nomenclature that we would use when we want to then query our graphql endpoint and that is going to be responsible to fetch the data that uh is being offered up right from our graphql endpoint so query is the way that you're going to read your data and queries aren't declarative notice here there actually was a question um i wanted to just point out that in this case he's actually asking specifically just for the name of the speakers right so there was a question do you have to get the whole thing back uh if you get a character no no you can just say i want the character and i just want the name of the homeworld and that's it it's one of the great things of graphql so this was um the next slide actually shows um where he's saying i just want the name um there could be you know 5000 other fields but just just give me the name that's all yeah and and by the way um deng3k in discord asks a wonderful question what happens if you query friends inside of top level friends how deep will it nest before breaking ha ha that's a great question so um this actually gets into a section i'm going to talk about in a second about some of the pros and cons about graphql you do because you have this ability to nest right to nest objects within themselves you could potentially end up in certain cases in an infinite loop scenario right and there there there's where you have to like employ rate limiting and stuff to kind of protect yourself from that but that's also ensuring you want to be very careful in your models now scalar objects and that kind of deals scalars like strings and ants those are called those are considered leaves right so imagine your graphql scheme is a big tree right and any of the scalars are going to be leads right you know to kirsten's point from a moment ago if i am referencing uh name and climate here of a planet they're scalars i can't go any further than this right i can't go any further than this at all um so at that point that's gonna stop but to uh dan 3k's points if i did have a like a friend of a friend of a friend of a friend i'm depending on how i do this i potentially will go until i run out of friends right now the good thing is something like french you will probably end somewhere right um and you can control that but that yeah that is something you definitely want to um but it is actually not we don't store it that way right there's no way to to say friend and then give me something from another table friend um you'll you'll have something to make another query to get the information about that friend so um while um i i love um i love graph databases that actually did that for you smushed it all together um it's it's it's more challenging and uh we're not there yet so um so right now you get what's in that table um you you'd get if you went ahead and threw some friends at a lower level you'd get them and they and they could keep going but um it wouldn't go to another table to get that information right right now um uh uh dude to be uh only read requests no you're not limited to just read requests that is just how you do read requests is use the query um there are mutations where you can and you're going to experiment with that today as well um so from a declarative standpoint so we say that you know queries in graphql are declarative right that means you can declare the fields that you're you're looking for so we're saying in this example here that hero we're declaring okay i want name field height field and mass field essentially is that's cool what's cool about this is is it's important to realize that where it says hero there he could write anything he could buy right my super cool query um that is basically uh when you make requests to graphql you you tell it to you give it a name for the stuff you want back and uh you can ask for three different you know bags of stuff with different names and that that word hero is just where you tell the graphql server where to put the info the answer to the question that you're that you're asking yeah and sunil to specify a graph query query words need quick query keywords need to be specified yes we're just about to go through and do examples of all those so you're gonna you're gonna actually do some queries and mutations in here in a moment we're almost done with this and then we're gonna get back to the uh to the exercises okay so mutation right this is now if i want to change resources if i want to create a table or something like that or if i want to add um add or update rows or items or whatever this is where i'm going to do it it's in a mutation right so mutation is the way that you change this would be like your insert update kind of thing and a query is the way that you read right that's pretty much what that comes down to now just to kind of pin this up right so graphql is actually really awesome in a lot of ways um we're not trying to come here and say it's the only way you can do things or it's the you know it's it's oh my god it's so much better in rest and the only way you should ever do anything anymore there are pros and cons right um there are definitely a lot of pros though for sure number one is the discover oh not number one but on the top of that list discoverability and introspection one of the really really awesome things you can do with graphql out of the box is and you'll see this in the ides that we use you can just discover all of the schema be right out of the implemented graphql endpoint you don't have to guess at what's in the payload or anything like that and what's really cool is the ides the graphql ides almost all take advantage of this where you go into like a schema section and you can just start going it down and you can just explore the schema right so it's really nice because what that means then is for whoever is implementing your graphql endpoint and that schema then that itself is is enough and then who's ever consuming it can just automatically explore it so that's pretty cool as we talked about the declarative data fetching you can essentially specify exactly what fields that you want schema stitching so i can encapsulate multiple queries if i want into a single query and just use one network call to get that and pull the results back um from the flexible versioning standpoint you can argue by the way uh we were talking about this one you can argue um you know like you can actually do flexible versioning to some degree in rest as well with http headers more advanced use cases there are ways to do it obviously and rest you have usually if you take a big like if you have a big breaking change maybe you'll make a v2 or a v3 of a particular rest endpoint here's the difference though in something like rest if you do that if you're not using headers then you have to change the endpoint in order to get the new update in graphql this is actually really neat let's pretend uh we use an example of using uh images like a logo right and images over the last ten years you know maybe at one point uh we preferred and our website bitmaps and then that migrated to svgs and then that migrated to pngs right um well with graphql i can just for each of those let's say we start with a bitmap field and then when svgs became a thing i just add a field it doesn't change it doesn't break any of the previous folks that were using the the previous version of the api they can just continue using the bitmap you can just add fields on that way that is one way to do that right but the key thing is you don't need to change the endpoint and anybody who's not aware of the previous field they don't need to be aware of it because they're using the new version if you will um and then from the match standards you know they use standards like json http which is really nice now some of the cons right um graphql is limited to a single endpoint um now you can argue this is another one you can argue a little bit is this better or not right because a single endpoint does make things easier in one way but from another standpoint especially you know from like a monitoring standpoint um if you have a single endpoint like in rest if you have different endpoints for all of your different sources and your services and stuff well you get kind of like you can very easily see where all that traffic is going in graphql you have to instrument your back end yourself to do that same thing because it's just a single endpoint right um so there there are pros and cons to both you could argue which one you want on that one now as i mentioned a little bit earlier um graphql is a little bit more complex it's more complex than the query it's more complex to set up your schema and stuff in the back end um however i would argue that even like when i've written rest services in the backend and java and stuff you still you still have to think about that payload and what's going to go back it's not like you stop thinking about it or something it's just that graphql forces you to create a schema to do that right and it's strongly typed and everything um obviously the graphql language itself it's not hard it's just a little bit more complex to get started with right so um and not only that like on the java end like if you're if you're doing graphql and you're on like front end javascript code you're you're golden right there's the apollo client um there's all sorts of ways that you can get at that on the java end um consuming graphql is a little more challenging and such so it's still young it just needs time to grow um then this ability to be able to perform all of these like nested queries and stuff is actually awesome for customers and consumers because they could do whatever they want the challenge can be though is then on the n plus one select because what happens if you have a case where you have nested references right and now you have something that in graphql looks like it's one query but just translate it into a thousand queries in your database right and that's what i was hinting at before when i mentioned this part about this rate limiting these two are actually related right you really need to be careful and make sure you have some rate limiting in place because let's say you do have a terrible n plus one select issue that goes awry you do not want to bring your service down from denial service because it's you know you've got infinite loop or something like that so there's a little bit more you need to think about from that standpoint um but you know again there's it's pros and cons there's never it's never one thing is perfect right um the last thing here on this list is caching caching is hard harder and mostly it's because of the declarative data fetching right it's harder to cache something when you don't know um you know exactly if if in one prairie you have one field that you have declared and let's say in another query you also declare that field but dependent on the data set that goes with and such you may or may not want to cache that data in that second query how do you do that right now the cool thing though this is where apollo if you've not done anything with graphql in front end totally check out apollo apollo apollo is a whole separate project from us and everything this is what netflix uses as well there's a bunch of others apollo is a wonderful graphql client and they actually have a caching layer in there that helps try to solve a lot of this kind of stuff so there's there's other there's other options for caching too if you use a cdn um i know akamai is big and expensive but uh they do actually graph uh the uh cache graphql for uh they're very very large oh come customers so um so they have they have been working on that um i um they're not the biggest open source people so but i i'm betting that that um that is is something that is out there somewhere as well yeah and adventure house is asking what is rate limiting um it just it's just essentially limiting the amount of operations you'll allow um to protect against cases where if you have like runaway nested queries or like uh infinite loops or something like that that you don't all of a sudden completely inundate your back end with a million calls or something like that um so that's that's what that means hopefully that made sense of interest and that's one of the reasons that you might have multiple tokens you might have an application layer token that that doesn't have the same uh permissions that's a good point yeah you can change how your application um behaves with a rate limiting based on the token that's being used so you don't get rate limited but the people who are using that token you specifically made for that application they can get very limited right and naveen asks does dgs use apollo i believe they do and as a matter of fact in the dgs tutorial that i've linked in the repo they do in fact suggest to use apollo um so they actually and then the apollo stuff will work you can you can follow it right along uh and do that yeah okay okay and then the last couple ones here so back end for front end what this is really about and this is actually these are kind of key points about it um back in for front end so imagine i have um i have a service out there but i have a mobile client and then i also have my desktop client the you know the the requirements for those might be different right but what's cool about graphql is i can be very specific about you know for the mobile client don't serve up the big images or don't serve up the big videos or whatever it is and the desktop client you know i've got you know more things that i want to expose there just because the different mediums and graphql actually makes it very very easy to kind of define those for both as we talked about from the aggregation piece the fact that you can actually aggregate your services in a query you can do joins and such offers up some really really cool capabilities and especially when bandwidth matters graphql shines right because because of the fact that you can very very uh clearly you know be explicit in exactly the fields that you return back then you can control the size of your payload that's pretty much what that comes down to okay so let me stop talking right yeah go for g has a specific uh question for you in discord i think it's probably best to to do in invoices [Music] let me okay [Music] fields of lots of children this route can help but rest will be handling away at having different endpoints the wire i mean basically what that what what he's asking is it's one of the things graphql is great about if you have a lot of things that are related to that um to that main resource and uh in rest you have to uh request all those resources that's a lot of it's a very chatty or thing so just like whenever you're setting up a cassandra database you if you organize your data so that they can make one query and get all the things they want instead of having to make 12 queries to get all the things then that's better but it's on you to put your data in a way that they can get it and it's on them to understand how to get it okay so with all that that's enough talking for a minute right we've done a lot of talking let's do some things right hopefully at this point and i will now zoom in i did not forget kirsten it's always funny having to zoom in on this though because it uh it ends up taking up like a million all the screen real estate and everything like that okay hopefully you are seeing something that looks similar to this right now another thing that will happen when you launched gitpod and the ide and matter of fact i noticed when i navigated away i think it asked me and i wasn't there it should have launched the graphical tab for you if it did not do that here's what you do in the very lower right hand corner notice this ports right click on ports go to 8080. this is only if it didn't launch the graphical tab and then click on the world icon that will then launch that into another tab and you should see the simple graphical example right this is going to be the ide one of the ids we're gonna play with so hopefully hopefully you are seeing both the ide with the java side so the java app by the way was automatically loaded for you with spring boot and stuff that was automatically loaded so the endpoint is actually already running um then the mpm part did a bunch of installs but we're not running it yet we haven't done that but now we have this simple graphical example so hopefully you're there with me okay by the way this graphical is embedded in the dgs framework that was so cool so they just provided it as part of the framework so that way you automatically have a tool that you can start to use with the graphql endpoint that you create with dgs okay all right so hopefully you're here with me so what we want to do now is we're going to go to step four experiment with graphical now how did you how did you open uh oh you let's i'll do it again graphql somebody yeah somebody's asking so if for some reason your graphical tab didn't just automatically open this is what you want to do down in the lower right hand corner you should see in your gitpad of ports right where it's 8080 in particular because that's the one we open i click on that it brings me up to ports here then you see okay 8080 is green because we expose that with our java app that's what's happened our java app started up and it opened port 8080 waiting for communication for a graphql endpoint all i have to do there's a little world icon right here but still you still don't have graph graphical which is what they're about that's what i'm doing that's yeah that's what i'm doing yeah so this little world icon next to 8080 will open the browser that will launch a new tab like mine did here that'll launch up graphical and you should see my endpoint this is my gitpod endpoint where java is running in graphical all right and it shows if you can't if you it's too dark but he's probably not talking about this one no maybe but i it probably you need to zoom i think yeah i'll zoom here yeah i can only zoom in here so much i've already zoomed in okay okay cool all right so so you really want to just get to the spot is where we want to get to now in this next section with this i just want to point out that you'll see i'm i'm i'm going to open this file here there's nothing this isn't for you to copy or anything this is just the schema right so here's what i'm going to do and this is this is also detailed in the instruction here but i just want to take a look at the schema we've implemented on the java backend right so this is again using the netflix dgs framework so i'm going to open this up and go to my schema schema you see this let me blow this up a little bit hopefully it's not too crazy all right oh that's too far too far now i'll just put it back and you'll notice that this is the same as here right now what we're doing here in this schema this is actually going to tell our code here are the types that we want to expose okay i'm going to have a show so this is like in a movie this is based on the netflix app right um so i want to have a type a query type called shows i want genres right so i'm saying i want to expose to my to my front end or whoever is going to consume these two queries that they could do either shows or genres notice as well that we're referencing we're telling it okay what types those belong to and here i'm defining a type a show type and a genre type and then my fields right so very these are very simple that's on purpose right so i'm saying a show can have a title or a release year and i type something in there by accident get that out of there um and a genre can have a value right and that's it so yep um if you have multiple queries you can't feed one of your queries into the other query right you would have to do that on the on the client side correct um not that i when you say what you mean you mean get the results you you do you do a multiple query right and in the top one you get name and then you can't pass that name to the second query i think you'd need to actually do a second query yeah yeah i would think you would need to like store that into a variable and then pass that to another one i don't believe you can do that but i'm not going to say 100 i have not experimented with that myself but i've not seen i've not come across it so i don't i don't 100 no on that one yeah okay so so like i said so we're defining this is our schema this is what the the java implementation is going to use and this is what we're saying we're going to expose to our consumers to our friend so this is the back end piece right where we define this so we're saying i'm going to expose these two queries and for the types that they belong to here are the fields that they are allowed to use now let's see what happens if we now look at some of our examples right so if you scroll down a little bit here and you'll see this query here i'm just going to copy that i'll go to graphical i'm just going to paste it right in here okay and then there's a play button up top and then i play it now check this out i said okay i want a query right so i'm going to read something i'm giving it a name that's all this is it could be any arbitrary name um and then i'm creating against shows and i want the title field now what happens now mind you that has to match i'll just pull this out so we can see a little easier okay if that has to match my schema that has to match what the graphic ql implementation in the back end is um so notice it shows genres or in this case i'm using title what happens if i do something wrong right i'm going to get a validation error right so this is something cool about graphql is it's got a validation layer in there it's going to let you know if you have done something wrong right so it will not allow you to try to query outside of what has been defined in the schema right so now if we take another example i'm just building it up right so notice now in this case it's not just title anymore i want to say with release year by the way in a lot of these graphql ides something really cool happens when you name your queries notice what happened here just title and with release here those are those arbitrary names i put um most of the ids i've played with do that exact thing right so it's actually really good plus this is good to do in your code it's descriptive it tells you exactly what the query is for um obviously these aren't as descriptive as i'd probably put in code um but i think you get the point right so so it's actually kind of a nice little feature there now the difference though i mean you can do the the multiple queries um you can ask for five or six different things with a single query and that that's going to save you that bandwidth hey yes david um we have a lot of people asking about the exclamation points after string and the definition of the types yeah absolutely i covered that real quick i i totally glossed over that yes this means it is required right it's saying it's required so it is saying that as a required field especially um when you uh when you go to update everything and just letting you know what you know we don't this is such a simple example i didn't do a lot with like ids or anything like that but that's yeah that's all it means okay so the example i need to consume that a little bit uh what part the where you are and where your cursor is right now yeah sorry over to the to the dark stuff oh you mean this yeah unfortunately when i zoom this too much this by the way this this is the same exact thing that is here in the repo um as well mondo192 they're run in parallel what's that uh multiple queries in the same uh request are run in parallel oh yeah okay okay so so here what i really want to point out here is just notice that these two the only difference really between them other than the name i gave it was one is querying against shows with just the title field the other one adds release here this is that declarative part right this is that flexibility standpoint so notice that if i say just title my payload is different compared to if i add title and release your right so i get more in the payload in this case but that's that control that we're talking about um now here's an example if we go down a little bit where we can actually filter now can i just add a filter to any query no that has to be defined right we defined it in our schema so again as the data owner is the person implementing the back end right you would define this you would say hey i want a filter where they can in fact filter on a title so in this case i want to say okay in my data set right i just want to get that one show right so so this is again kind of just stepping up some of the things you can do but the key thing here is that notice that everything that i do everything that i define that is what i'm limited to in my queries i can't just kind of query outside of that yeah what's up christian um there's actually some really good um ideas right now around the the the date um uh could you get all the shows like after 2015 or could you order them by year and yeah i thought and and some of this you know one of the things about graphql is sometimes you're going to need to do things on the client side but it does give you some stuff for free so um i just wondered if you could um grab those because i thought they were good questions yeah yeah absolutely no like order by date and stuff like that you can you can totally do that right you know one thing i need to say from that standpoint graphql is extremely expressive it is a very very expressive language there is a ton you can do with it as a matter of fact one of the resources that i put here in the repo you should all check out right uh the graphql.org start there right um that is gonna spell out all i mean we're only scratching the surface here today right um you know for for what we we're what we're doing here we're scratching the surface there is so much more you can do with that but yes you can do order buys and things like that yeah it's it's a very very expensive language all right so now on to the next example here this one so this is an example of now aggregating two queries notice all i'm doing i'm not joining them all i'm doing in this particular case is in a single query pulling the results from both right i'm getting shows and genres right i don't need to access different endpoints for these different services i can literally just aggregate them write the same query um so you know in the the whole goal of this is just to kind of show you some some of the ways that you can start to build on you know what you're doing and how you can use that to optimize things um one other thing i want to show you here in graphical is the docs remember i mentioned earlier that graphql one of the really cool features is introspection right so you can use a lot of the ides to start to kind of explore your query and see what can you do right what is a show oh a show has title and release year okay so if i wasn't exposed to this on the back end which you're probably not going to be as a front-end consumer or something like that then i can still in a lot of like i said any of the ides i've used do this where they allow you to explore what the schema is right off the bat right so the fact that you have that in there is actually kind of really nice and this is the way that i would start i would start building my graphql queries like this and then once i have my queries and i got it worked out now i can put them in my code right now i can start figuring that part out okay so if you have gotten to a point i want to move on to step five uh just to make sure we have time to get through it if you've gotten here and you did the graphical stuff give us the thumbs up let us know that you're doing it ah manish yes we've not updated the token in our application to get access great great question and i kind of i kind of maybe glossed over something here so let me let me step back for a moment and explain something so as part of this you know here i'll i'll cheat and show you under the hood a little bit so it's part of this whole git pod setup there's a lot going on here but here's what i want to point out notice there is both a back end and a client example so what i've what we've done here is we've instrumented a simple java back end as a matter of fact i'll go ahead and show this to you because i matter of fact i'm glad you said something because i kind of forgot to mention this to you all um so there is a simple java back end right here that essentially uses that same this is the schema the graphql schema we're using and this is the implementation now in this case i'm not hooked up to any data service we're not talking to a database yet i'm literally it's literally hard-coded right here in the java code right but it conforms to that schema so funny enough from a consumer standpoint you would have no idea that this was all hardcoded or on a database or or not or you know something like that um and the point of this again was because we're kind of kind of just showing both what the back end simple back end might look like and then what the front end looks like and then we're going to hook it up so in a minute pretty soon we're going to hook it up to the back end um by the way i'm seeing a lot of thumbs up come through thank you um one thing i do want to point out this is probably the simplest dgs framework setup you can have notice these annotations here djs component dgs query um the you know the component is where i'm going to get my data from the query is you know that's the thing that's handling the query that comes in right um so matter of fact if you noticed when i'm logging here and you should see it even though um yeah right there i see query executed genres you know value so if i come back over to my graphical example and i do just title watch do you'll see this move right so it says shows title is stranger um stranger things right so this is the part that's actually responsible for handling the query when it comes in and that's where i'm just you know doing some simple logging but this is enough right here this is actually the basic now it gets it can get a lot more complex than this for sure but this is the basic thing by the way for those of you who are our java developers who might be looking to do something like this on the back end um in the repo if i scroll up a little bit here right here this netflix dgs framework tutorial right that's your friend go there start that that will essentially show you how to build all this with spring initializer and everything it's a really awesome tutorial it's what netflix uses which is really cool there netflix is really out there um out front um you know they release all sorts of stuff that folks can use all the time and this is one of them yeah hey manny that's i'll go ahead go ahead kirsten uh aj we do actually uh we're just about to put out an astrojs graphql library for node.js so um so you'll have that available yes and we're just about to do the node.js part as well yeah right so um money in discord can we see the schema of the underlying tables especially the key columns well funny enough the schema is literally this this is the schema we are using for this right now that is only implemented on the java backend in a moment when we move over to asteroid and we hook that up then you're going to see that schema so that i want something i want to clarify here we actually have two different data sources we have the java back-end that is right in front of us and then we have astra with graphql that we're going to hook up here in a moment right those are actually two different backends now for those of you who are veterans uh because we did see that we had some graphql masters um then you know if you're hooking up to different endpoints now you start to get into a whole different world like you know federations and stuff we're not doing any of that today it's way out of scope um but you can do that with graphql it's actually something else you can hook up disparate uh sources and such but yeah we're not doing that but this this is the actual schema this is the schema that we are reading from that we are using from the java backend all right so when i had asked before about thumbs up i did see a bunch of thumbs up come in awesome so i want to move on to step five here and now get into the react fun so i'm gonna go now all of you should have two terminals because that should have automatically launched for you the left one would be your java one the right one will be your uh your react one notice the directory should also be in graphql client examples so you want to work out of the right one here and the first thing we want to do is we're going to install another wifi um you might be wondering why exactly are we installing netlife what does it have to do with anything um so on the react js front end piece i kind of cheated um not really this is actually a practice that we would usually normally use but like since we are talking to uh the astra back-end and real database and stuff like that i had originally started out doing this stuff where i just put everything in index.js and i wanted to make it easy so you could like read everything in a single page but then i had a bad taste in my mouth and i was like that's not the real way i would implement something like this so i ended up going the route of using serverless functions to implement um the calls to my graphql endpoint um so it it increases the complexity a little bit but that's why we're using nullified it's the only reason why we're doing that um funny enough for those of you familiar with nutify then you could do you could use this to then deploy to nullify but we're not doing that so do the npm install like i just did it'll download a bunch of stuff it just takes a moment then we want to go ahead and do a netlify dev this is going to run the environment there we go it's going to spin up our react.js app oh uh tashar the data flow in this particular case is actually the job the astrodb part and the java part are separate consider them two different data sources they are each their own graphql endpoint the java is one astrodb has its own they are totally separate so it's not flowing from one to another yeah so surround john is there a possibility that con netflix graphql will become likes or spring framework who knows i don't yeah i don't know yeah i don't know on that one maybe it's a really cool they it's a really nice framework they did a really awesome job i think all right so once you spin up nullify dev you should see something like this right now it is normal at this point that and this is going to that question that i just saw um a second ago about is it java or astrodb or something like that the local is going to the java back end okay where the astrodb ones we have not hooked up so they're actually sitting is is loading right now that's how it should look but also i want to point out that notice the data in shows right if we come back over when we looked at shows these should match right this is the exact data going back to i put it away so remember in our java back end we hard coded the data right so this data here is exactly the data i'm seeing here all right so i'm just consuming i'm just consuming the same thing i'm executing the same query same exact actually this query i'm executing this query in my front-end code right so that's that's the data i should see is exactly what this is and i want to make sure you see that one to one right so this thing the react piece is just over graphql it is performing that query to get this data all right okay so um now if we take a look at some of the react js javascript scripts javascript files so i'm going to go into uh client examples you'll see i give the the exact spot you need to go to client examples functions right in particular get shows back in and get genres back in so if we go to get shows back end put this over here too all right here's what i want to point out notice this query this is it right the rest of the stuff is just essentially making the fetch um to our endpoint to our graphql endpoint but at its core this is it i can literally just take that same query and then i can execute it and and return that result and that's what we're turning here um there is some more as far as like injecting this into our state and everything like that with react um that's actually happening in our components down here where are my components there we go so i have a shows component i need to put this over here there we go right so you see i'm calling this get shows back end that is calling the back end that performs the query um i'm not going to go a lot into the into the react details and how that works but what's really happening here is we're actually just setting state we're setting a gcal with the result of our graphql query so that's this query the one we're just playing with in graphical so i'm going to use a state gcal result to asynchronously fetch that once it returns i'll set the state and then that is the part that is responsible for injecting that directly down into our dom with react so if you're not familiar with it this one i was when people are asking hey do i need to have any requisite knowledge this is the part that i was talking about like it's better if you know react if you don't that's okay go to that other workshop that we have um but you know this i you know hopefully the comments in here will really kind of expel that out for you but essentially we set the state when the asynchronous fetch to the graph ql query comes back then you can just access here's my result now i can actually just access um the path to these what's really cool too um if you take a look i'm going to move over my screen here real fast and go to let's see that one when you get a chance um could you check out bill zombie and in discord um i i think something's up yeah we'll see okay give me a second i'll finish the statement and then let me take a look okay yeah um so here's one last little thing i just want to show you is when i make the call to the graphql uh you know from the you know to the to the service function that's actually making that call to graphql and performing executing that query here's the payload that comes back right it's a json object right so notice then in my code that's exactly what i'm accessing right and so these fields will match exactly what that graphql query definition is right so across the the whole end end to end whatever i set that schema up that's exactly what i will get as my payload in my result all right let's see and let's see i'm looking at some questions now oh yeah um yes there is another workshop um for the react part of it i have in fact dropped it into the repo as well but let me pull that one for you and drop it real fast i think i actually put it right up here oh yeah here it is i did i put it in the very top but here it is here so for those of you who are not familiar with react and you're wondering oh thank you someone beat me to it ryan ryan beat me to it thank you um yeah if you're not familiar with that then ryan is dropping the react part so you can kind of learn there what's going on from that standpoint all right let's see how are we doing on other questions and i see gamer said let's see so basically we could actually use the existing back-end code written for different existing rest endpoints and set up gql schemas using existing services i don't see why not yeah i don't see why not at all gamer okay so um uh bill zombie if you if you scroll up a little bit i see it um yeah i'm just not sure um the browser popped up after running those commands um i would say that my question for you zombie is i don't know how well you can see this down here but are you in the terminal for the graphql client examples that's where you want to be and i happen to notice that there's double quotes in your what you pasted there um so just to ensure there should be no quotes at all around any of this right notice that it's just literal right there um so yeah but the key thing is make sure that you're in the graphql client examples directory it should have already been there for you but you want to make sure that's where you're at okay all right so let's see let's so this section this next section is really the part that's talking about the react piece i'll i'll let you kind of digest that on your own um but again the key thing that i want to show here is that here we can just we're just fetching against our query by the way notice in this case this is a simple fetch i'm not doing anything more complex now this is a place where you could use apollo client um and again in the repo there is an apollo client that's there um there's a whole tutorial on everything you can go through um it's what netflix and others use it's actually really awesome apollo clients really cool um the only reason i did not i actually started using it and i decided not to um just because of the way that i was mapping out this app and uh i i didn't like a couple things so i just i just decided to do with a simple fetch right but this is i mean this is as simple as it gets um i'm gonna use fetch i have some url which is by the way my graphql endpoint um that in this particular case you know if you're on git gitpod it you get an endpoint if this was local this would be like localhost 8080 graphql or something like that um that would actually look just like this this is the java app right this is the java app in my localhost um it exposes the 8080 and it's at graphql that's what i would put in my env in order to do that but because we're in github or a git pod with this it generates a more interesting endpoint uh so with the scripting that's in getpod i kind of pre-did this for you um but notice here that should match your gitpod endpoint as a matter of fact if i went to this then that'll give me the same thing saying hey there's no body in this thing but then that's where comes into play so this this uh graphical ide is actually talking to this endpoint right so they're just talking right to each other all right so let's see so what i like to do now is in lieu of time because we've got about 10 minutes to do this last part oh i do have yes orlando i have two dogs here [Laughter] yes um oh yeah v chandra does graphql support uh paging totally yes um interestingly enough i don't explore that here but in our follow on in the netflix clone workshop we do explore paging in that one um and that link is at the very very top of this so if you do want to explore that then paging is there yes yes all right let's see i don't know why now if i dove isn't working for a princess it's odd i mean in a worst case scenario um you know in a worse case you could always just launch another git pod but yes that is interesting um it it and if you really need to you can always go to the pod yemen uh all the commands are there but the key thing is just to make sure that you're in the right directory you've got to be in that graphql client examples if you do it outside of that it's not going to work right all right so moving on then to the fun with hooking up we want to hook up the data layer okay so we now we've got the the react app that it's talking to the java backend right and it's schema and that's what we're seeing here but now we want to go one step further and we want to hook this up to our java backend or i'm sorry our astra backend database so before we do that um could you just quickly go over the part where it's calling the uh the java um the the code in react um we have we have a question on you know how is it actually calling yeah graphql from the react up so if you look at the react code before you add the new stuff that'd be great yeah yeah um so what what we've done here if you take a look at one of the examples by the way this is also you know if you go back and do this like in the in and like go through the workshop like the text this is all also explained there as well but you notice in this get shows back end right this is doing a simple fetch off a url which is our graphql endpoint and in the body of that fetch is our query notice this query matches the same queries that we were working with when we were working with the ide here right that matches that so here's the query that is literally the same thing other than the name that i gave so this fetch then when we call this right and this is called when in this case shows is calling it right here okay so i'm calling the serverless function that is responsible for doing the fetch the graphql query you just saw right here is the react part then i'm doing an asynchronous right we're getting a synchronous call to this back end wait for the result it sets the state of my gql result and then that is what is being injected down into my dom so when that state changes and it is updated with something then we get all of the values that we can just inject into our dom so hopefully um that answers that question all right all right so going on to step six here so we want to go back over to astro now here's where we're going to hook up to astr we created the database earlier right and now we want to um we want to hook up our app to that so i'm going to click if you notice when i go to the dashboard i'm going to click on the database i'm going to click on the database that we created which is i have too many of these there so i'm going to click on the database i created you're going to get to a detail view you want to go to connect in there go to graphql api here you will actually be given the endpoint right now the first thing i want you to do is you're going to go to now the graphql playground right this link that says launching graphql playground this is your own endpoint by the way so you can't share this or anything this is for your database so you're going to open that up again i'm going to middle click or right click and say open link in new tab that's going to open up the playground and you will see this playground now this is directly linked to your astro database now here's something really important about this at the very very bottom down here you'll see this http headers you need to put your token in here remember i said hold on to that token that's why i said that so i'm going to come back and get my token the one that says astra cs i'm going to grab this i just use that copy widget i'm going to populate this oops a wrong button populate this section right and oh look at that now now it's going to let me authenticate so the first thing i want to do here is now we're going to create some new tables we're going to do this with a mutation right so remember i said queries are read only for how i'm getting data mutations are the way that you're going to create something or you're going to change something or add something right so i'm going to use this mutation i will put this then overwriting anything that's in there in my graphql schema tab that's the one i want that first one that was opened with my token if i then say play i'm now going to create this table called reference list and here let me blow this up a little bit because i know i'm going to need to do that there we go all right so when i get this response it's telling me it created the table i now have a table called reference list this is from the netflix clone app now once i've got this great i have a table but i want to do a little bit more i want to insert some data into that table so let's use more mutations but here's something key notice i'm in the graphql schema tab for this that is for schema changes but when i want to do things outside of that i want to like request data or if i want to add rows or something i want to go to the graphql tab and when i do this i need to come back down to my headers and populate that token again i'm gonna go grab my token put that in now there's one other thing i need to do and by the way this is all explained this is all here in step 7 when it says insert it it tells you here this unfortunately i'll admit this is a little is a little hard to notice but the end point this endpoint's important so what i want to do there's two ways you can get the end point one it's actually sitting right here right that's one way to get it another way though is you can just update the system to the key space that we used right so this is the key space this netflix key space is the key space we created earlier in our database and a moment ago notice our key space name is also netflix key space so when we created this new table we're creating it in the netflix key space and our endpoint is also going to be that netflix key space so now i want to take the mute all these mutations these are all my inserts right i'm going to put some data now into that table so i'm going to copy this from step 7c now paste this in i'll hit play and oh what happened there did i fat finger something i may have thought for you something oh i did aha no okay this was actually a neat example i'm glad that just happened so notice what graphql did right it's actually got an error object that will get returned um if something goes wrong or something like that in this case it was an authentication i actually messed that up so let me try that again let's see i i must have fat fingered something let me grab that again let's try that i must i looks like oh i see what i did all right probably not i see what i did aha tried that there we go cool i fat fingered my own stuff all right cool okay all right so now in this case you see let me back that out a little bit so i used mutations to do all of my inserts and now i inserted a bunch of data into the reference list table yeah i've blown it up as much as i can unfortunately um always limited on screen real estate from that standpoint all of the mutations and everything uh gabino and stuff they're here in the repo right so step 7c um step 6c that's where all the mutations are they're right here in the repo now finally once i've inserted the data into my table i can perform a query by the way i don't i can just leave that mutation all these in here and i can just put this i can just append this into the end because they're named now the playground will let me choose which ones but now i can go ahead and select them so i'm going to select them and now i have i see i have data here yeah if you're unable to authenticate um just make sure like what you saw what i did make sure one that you have your token filled out and make sure two which is what i did i fat fingered the end of it by accident and i had by accident um carriage returned that down to the next line so make sure that you just have that single line and that your token is in fact surrounded by quotes because that's exactly what i had done and that's why it didn't work but you should just be able to use that token make sure with your token that you are using the one that says astro cs the token that's the one that you want ask for cs okay uh let's see oh pato the reason why we got the error um is oh it depends on the area you're talking about but the reason why we got that error at least because of my case is because i i fat fingered my token that's what i did all right okay so now here's the thing we've we've now set up a table a reference list table we added data and we saw that we have the data there right but now let's go ahead and do the the finishing part that hooks this up to astra and our app right so i'm going to come back over to my app now i already had mine killed but if yours was running i'm going to do a control c i'm going to kill the app and the app is the react app right so if i try to run this it's not going to do anything because i've killed it now i want to run this command this aster setup this is a convenience it's a convenience method what it's going to do is it's actually going to use my key so i'm going to take that same aster token we've been working with i'm going to paste that in here okay and that this is kind of it's a nice little helper method remember before i showed you my env file and it had just a java graphql endpoint well astra setup went and it used that token and it said hey i'm going to find your database and stuff based off of the parameters i just passed in right here notice my database and my key space name that's what we created and it takes all the values i need to authenticate including my graphql endpoint right here and it injects them into my.env file it's really nice so it's an awesome little tool that you can use to it's a nice little helper now if i go back and i start my app again now if i dev will see that ah and injected all of my environment variables it's gonna start up and now when it runs i should see that reference list remember reference this is the one that we just created has all of the as all of the data that we just created and if i take a look at the playground notice i have things like anime and award winning and stuff like that if i go back to my app i have anime award winning right this is performing the same query that we see right here in my code and then again just like with the java back in the difference the only difference really is that we are talking to the astra database backend instead of java in this case all right now if you've actually gotten here that you want what what is it you wanted to do again anchor yeah yeah let us know what you're referring to that encore yeah we can do that um yes and rahul you read my mind [Laughter] if you if you got to this point give us a thumbs up oh the error yeah yeah yeah so i'm glad you saw that uh who was that ajay yes this is on purpose um matter of fact this is part of the homework right so step the rest of this is actually here part of the homework i'm going to leave that to the homework um i want to give you a little hint though um this this is actually part of how and i'll actually show you real fast um yeah so if i have if i try to perform a query that say doesn't have a table or doesn't have data or something like that then the validation layer in graphql is going to bubble that up to the errors object right and it's going to tell you exactly what it is um so in what i've done is remember i only created one uh the the the reference list table i did not actually create a shows by name table yet right that is actually coming up um so i wanted to illustrate that because i thought it was important because graphql does a really nice job in the validation end and on the error end of bubbling that kind of stuff up right so if you do something wrong if you're trying to do something outside of the schema or something doesn't is it's going to tell you right it's going to tell you in a very explicit object and the code for that too you know to handle that error case at least a simple version of that code is in this by the way the apollo client does a really nice job with errors they just handle that for you they actually have like a little errors object that automatically handles that for you it's really really sweet so i really i really suggest taking a look at it okay all right let's see yes exactly uh vamshi the validation error um yes so if you're getting a validation error it tells you it tells me oh is that what you're answering kirsten yes you are okay yeah yep yeah you already got it all right so the rest by the way the rest of what you do about the error is part of the homework that was very astute observation of jay um i did see a bunch of thumbs up for folks who actually got here but now it is time for us to move over to our swag quiz so we can get some swag on and end on time and do all that fun so let's go over to our swag quiz let's get some fun stuff going all right so if mentee lets me move on yes savvy um yeah you can connect to sql or our nosql databases right um well but so you still have graphql an engine in the middle right exactly it's not natural it's not something that that that all databases do right we don't that's just that's right we're yeah that's where stargate comes into play exactly so so to that point to kirsten's point and that simple java back-end we have i would hooked up that i would hook that up to the database right i would hook that up as the there's the back end code provider and the person providing the graphql endpoint i would hook that up to my data source and then that would be the part that maps to that database it could be any database that you could talk to with code um but it's not you know there are some databases out there that do have graphql that work with them like what you're seeing with stargate and astra and stuff like that allows it um there are others that do something like that but she's right yeah yeah you've got to have some that's that middle layer right so you do have something that is connecting to the back end database um along with your graphql schema and then that's what allows you to consume it okay so i'll give you all a moment to get your names in yeah yeah manny definitely put in some screenshots please all righty i'll give everyone another moment we got a good amount of folks in the mentee awesome awesome awesome awesome all right so key thing about the mentee when you're doing the mentee look at your phones there could be lag in the feed and speed and answering matters so look at your phones are we ready cake i like that sean cake all right first one graphql is a query language a server-side runtime a query language and side runtime something you plot data on all right let's see what happened here oh that was tricky it is both a queer language and a server-side runtime right so it's both you can you can do both that was tricky right out of the gate but that's why we create these questions for that all right so let's see what happened in our leaderboard that was kind of mean david all right so fungus is in the top of the fastest time aj hello uh number two and that looks like arturo number three and all right let's see what happens in the next question i might be oh i may have been mean in this one we'll find out i'm sorry i'm sorry all right question two are we ready let's do it graphql is strongly typed no it depends yes only if it takes protein powder you can't hear the music kirsten i can dance over here my typing is not going in um uh depends all right let's see what happened to our leaderboard yes it's strongly typed yes it is i it depends with me being mean um i i did that to throw everybody off but yes it is strongly type it is absolutely strongly typed uh unfortunately nobody grabbed the protein powder joke of course they probably want to win the swag quiz and not just throw it so all right let's see what our leaderboard looks like now oh look at that so there's this fight between ajay and package there at the top and arturo holds the third spot let's see what happens in our next question all right three of five what is the main feature of graphql declarative queries has lots of x's and y's decreased network load multiple endpoints by the way i want to say that um all these guys are asking fantastic questions this is gonna make it you know this is our first time running this and yeah we're learning a lot about you know how we can make it even better so thank you so much um yes we don't we we appreciate the the questions on the internet yes we do yes we do and you know uh you will if any of you two um you know this is best on discord but as especially for the it could be anybody but especially for our graphql masters and that kind of deal um or or for those of you who are first learning about it if you feel like there are things that you you know you're like i i could have known more about this or you could have explained more about this please let us give us feedback in the discord let us know yeah let us know all right so this one where i was maybe tricky in the beginning i think i made it nicer here because you actually had two answers that could have been right declarative queries and or decreased network load are both correct in this case from the multiple endpoints standpoint really a main feature is actually the single endpoint you could argue if you're talking federations i hope that was my veterans who did that uh and answered those you could argue well wait a minute you could have multiple endpoints that the key thing here though is the main feature is really that single thing that that single endpoint is no matter how you say aggregate queries and such like that right um so maybe that one was a little too tricky too uh especially for those who are familiar with federation i just may have thrown you off sorry about that all right let's see what our leaderboard looks like and i will um i'm gonna do a quick uh shout out we do have a workshop feedback uh uh uh channel in discord uh that you can jump into and and give us any feedback that you have about the workshop and and uh if you do if you give us some really good feedback um there's there's a possibility swag might happen so good point we uh we really we really appreciate um letting you letting us know um you know how it could be better or uh what you're looking for yeah absolutely absolutely that's a good that's a very good point so package takes the lead again with the fastest time to lock jumps up to two second place r2 is just holding third place like nobody can get arturo off of third place so very good arturo for staying the course there all right let's see now it's still i know jay you got knocked out but you're still there you're in the running it's anyone's game still all right question 405. let's see what happens what does astrodb i just gave you a softball right give you the hard ones and throw your softball here it's a managed cassandra with api and tools it's a local in-memory version of cassandra it is a cloud-based ide it's a movie with leonardo dicaprio i'm not familiar with um unit testing tools for graphql but i am so certain that they exist because netflix doesn't do stuff that they can't test so yeah it's a matter of fact i know there's got to be some great open source yes and in both the dgs framework and the apollo client they have testing it's not obviously you could tell we wouldn't have had the time to even touch that um but both of those uh both of those do have um already testing frameworks and harnesses and stuff like ready to go for you um it's a whole rabbit hole right so yeah the the netflix app that does the follow on that is a node.js back-end so um it it uses astra directly and um you'll be able to to play with it uh we got a link to it in the in the workshop so all right so the correct answer here it is a managed cassandra with api and tools you're using the graph api today awesome looks like the mouse majority you got that right so let's take a look at our leaderboard what has happened in our leaderboard [Music] um we will probably improve this one um and we're also going to work on really improving the netflix ones so they're both more accessible but we might do an advanced graphql one um you know when when uh when we add new features uh for sure like uh federations coming up um we might have a you know a schema schema first method of accessing the data as as more things come up we'll definitely make more content all right so package passes time again package takes the actually maintains the lead to lock in second oh arturo you're so okay there's one more question you can still get third place because i just want you to get that because you were still there and then i see some uh is in third and j is right there on on tom's heel so let's see what happens here uh last question all right last one for all the marbles let's see what happens in graphql how do you change data or execute actions insert update a transform mutation or variation and i'll take this to answer the question of certificates what we have certificates for right now um it's learning cassandra and uh cassandra admin um we have tons of other classes that you can get badges um we if you subscribe to our channel which we love we love people to subscribe to our channel um you can look at um all the other classes that we've done we do this weekly um multiple times a week and um and you can learn all sorts of cool stuff all right so the correct answer was mutation it looks like the vast majority see when the vast majority of the folks get the right answer i feel i feel like we did our jobs i'm glad so yes mutation is the way that you're going to change data or execute actions so what happened this is for the win the top three winners we'll get our yeah let's see what happened arturo not that our tour is the only one we care about you know like oh so package takes the lead congratulations package with uh vishnu comes out of nowhere and jumps into second and then ajay takes third congratulations so if you are packaged vishnu or aj take a picture take a screenshot of your phone right now because i'm going to show you a slide in a second you're going to want to email that to jack.fryer at datastax.com um because that is how you're going to get your voucher for swag awesome so again i'll leave that out here another for package vishnu and a j oh yeah we're saver saver logs we are just about to do that promo cred yeah the promo code yep so this is the part for those of you who are in the beginning we're asking like hey how do i can i get a like do you have certificates or whatever and that's what curious was just talking about we're just about to drop that right so that's a thank you for for coming with us to the workshop now there's one other part in here is i just go on with a couple slides we'd like to know what other topics languages or frameworks do you want us to cover in the future and then i'll leave that up so you all can answer and then let's just talk about a couple things i'm just going to pop through here all right blah blah blah we did all that all right here we go so for our top three winners of the swag quiz jack.fryer datastax.com um that is you want to email to get your voucher for swag all right so make sure you get that if for some reason you don't catch this or something come reach out to to me on discord or or something like that but yes jack defrayer datastax.com all right now for the voucher okay separate from swag and everything like that and i said thank you for coming here and being with us today scan the qr code or um just use the link and that will bring you to a form and you have two choices one you could in fact uh choose one of the um the learning paths in academy and by the way everything in datasets academy is completely free again all of our learnings and all that are always free um and what that'll do is these learning paths either the admin the administrator certification for cassandra developer for cassandra or kate sandra which is cassandra on kubernetes for those of you operators out there all of these actually have certifications that you can get and they normally cost 145 bucks each attempt the voucher will give you two free attempts and they can be used any way you want right so let's say you want to take the admin one you pass it you're like oh i'll go for dev go for it or maybe you go for kate sandra and don't quite make it the first time you can just retake it right that's two free attempts for you um so scan that code to get it there is another piece on the form that if you want to get some astro credits you can also do that now the cool thing is that everything you did on astro today for millions of reads and writes i think it's 80 gigabytes of storage and stuff is totally free right and that stays free indefinitely so you can just use that free tier use that for your database and stuff like that uh the credits come to play after that if you ever go into a point where you're expanding past what the free tier gives but the pre-tier is pretty darn generous so again scan that code to get free stuff that we want to give you and i i want to point out also um you know also please again subscribe to our channel um if you are going to go for those certifications which are great um you know we didn't talk a lot about cassandra but if you know cassandra is super uh it's super popular among most of the largest companies so it's a great thing for your resume but what i was going to say is we do have classes that are specifically um prep for uh for that um certificate test so you know we go through and we talk about the different things that you'll be asked so you're much more likely to pass that if you if you check out one of our our workshops all right i'm just responding [Music] do a question feel free to i don't know when cedric is is next scheduled he's a very busy man yeah right all right so for the homework uh by the way um you know again the homework is at the bottom of the repo if you go to the once you get to the end i will there's an anchor that brings you back up but don't forget the homework is also that homework section in the repo everything that you need there um for the homework it's there what we ask you to do in this case is just go ahead make a show you know add a show or genre of your choice just modify something just do a mutation and show that in the react app right it actually should be as simple as modifying one of the mutations that you use in the workshop right just show us the results of that that's really all you need to do um net and i really really encourage you to finish the homework part of step nine through step nine because that gets into the error handling part um it's just a nice feature of graphql we also have a whole new set of um or another set of workshops that are coming um we do these every week as kirsten was mentioning so we have an introduction and no sql databases that's coming up um a designing and planning cloud migration is awesome for folks that are more on the ops end um and then we have another one with react and such like that as well so again those of you who maybe are new to react that could be a good one to take a look at if you want to know a little bit more about more nosql databases and stuff like that including cassandra the intro to nosql databases is as good as that so definitely something to check out we're doing workshops every week join us on discord again you can do bang discord and the channel there uh in the in the youtube chat that'll bring us here this is where you can continue the conversation especially if you have follow-up come reach out we're here we want to hear from you uh and with that thank you all so much thank you kirsten and it was it was a pleasure it was a pleasure doing this this was this was a fun one honestly before we go i want to tell possibly yes we are working on python um and uh that that will be coming up um in the next month or so we'll have a workshop that includes python awesome and with that thank you everybody and take care we'll see you next week bye-bye and as always don't forget to click that subscribe button and ring that bell to get notifications for all of our future upcoming workshops imagine a being gifted with powers from the goddess of cassandra he grew those powers until she could multiply it will move with limitless speed and unmask hidden knowledge with those powers she was able to fully understand the connectedness of the world what she saw was a world in need of understanding from that day forward she sought to bestow her powers on all who came into contact with her empowering them to achieve wondrous
Info
Channel: DataStax Developers
Views: 4,067
Rating: 4.9663863 out of 5
Keywords:
Id: v-JC7TAr4mQ
Channel Id: undefined
Length: 133min 41sec (8021 seconds)
Published: Wed Sep 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.