Good evening and welcome to Public Affairs Public Access on Houston Media Source TV. I'm Gene Pruice with the League of Women Voters of Houston. The middle of February 2021 saw a blistering record winter weather across Texas and Houston with the arrival of winter storm Uri. The harsh winter temperatures took several lives across Texas, disrupted much of the state's infrastructure, electrical service, internet, telephone, water delivery, and icy roads also played a role in limiting repairs and restarting lost power to many areas across Houston. Tonight we'll learn how Northwest Houston was affected. We'll talk to Houston City Councilmember Amy Peck from District A to tell us about how winter or weather affected her district. We'll also learn about the state and how it gets its electricity. We'll visit with Manti Cummings of Interjia Veleta to discuss the future of wind energy in Texas. And Dr. Gavin Dillingham of Houston's Advanced Research Center, HARK, will talk about energy and a Texas power grid. Before the COVID pandemic, our show was broadcast live, but for the past year we've been pre-recording our interviews. Tonight's interviews were recorded earlier this week. First we talked with Houston's District A City Councilmember Amy Peck. With me this evening is Councilmember Amy Peck. She's from District A in Northwest Houston in Spring Branch where I live. She's my district member, so my district representative. So thank you very much for appearing to be on the show. What did you see during winter storm, Yuri? What were some of the problems, some of the concerns that grew out of what happened in Houston? Well, first, thank you so much for having me. I appreciate it. In District A, we saw very similar things to the rest of the city, to the rest of the state. People were without electricity, without water for extended periods of time. Myself included. And I think that people weren't as prepared for this as you might be for a hurricane. And so we saw people who were without water, and we were trying to get water to people. Because you just don't think that you're going to be without water for a winter storm. So it's something that a lot of us have never lived through. And so people were without necessities for a very long period of time. I think the weather people had told us, a storm is coming, and it's going to be cold. But I don't think anybody anticipated what 20 degrees is. I've lived in other parts of the state, and I've been to other places where it was much colder, right? As you're saying, we weren't expecting that. We weren't prepared for that here in Houston. Have you talked to other members of the council to gauge how they were reacting to it? Yeah, it sounds like in other parts of the city, talking to other council members, people were in very similar situations throughout the city. In District A, it seemed like no one had water, working water in whole neighborhoods. It wasn't pockets of people who had burst of pipes here or there. We were without water in District A. And I know some other districts had similar situations as well. But I think that people just weren't prepared for this storm because you would never expect that the electricity would go out for the entire state of Texas. No one ever expected that to happen. It shouldn't have happened, and it needs to never happen again. Well, I've been trying to educate myself to be honest. I had no idea what ERCOT was, or I'd never heard the word before. I don't think the idea of the grid. And I think it was a harsh education for a lot of folks who are trying to find out what exactly happened. As far as Houston is concerned, and city council, what, from your perspective, are some of the things that maybe we can learn? What are some of the takeaways we might learn from the storm? Well, I think for the city of Houston, one of the big takeaways for me is to make sure that our technology or equipment or infrastructure is in place to handle water concerns. So the electricity issue, that's a state issue. Of course, it's my concern. Any concern for my constituents becomes my concern. So although I don't have direct jurisdiction, regulatory authority over the electricity, but what we do have direct oversight over is the water. And it seemed like there was failure in that system. And the generators, the backup generators, there's still a lot of questions that need to be asked, that I will be asking as far as did the city not do enough to weatherize and put precautions in place to make sure that this wouldn't happen. Is this just something that no one could have ever expected? I have a lot of questions going forward and have asked for a TTI committee meeting about this and the chair and vice chair of that committee. They've already been working on that even before I asked for that meeting. So there's a lot of questions to be asked about this. So can you tell us what that TTI means? It's the Transportation, Technology and Infrastructure Committee. OK, and what are they responsible for? So they're responsible for a lot of different things, technology, infrastructure, the drinking water operations, which would fall under that committee. So I've asked for a committee to kind of go over what happened, what wasn't working, what was working, what can we do in the future to make sure that this doesn't happen again? Because we've seen hurricanes come and go where the entire city didn't lose water like they did in this situation. So we need to make sure that, you know, the chances of this happening again anytime soon, probably it won't. But we need to be prepared for anything at this point. I think if the year 2020 has taught us anything is that we need to be prepared for anything and everything to happen and make sure that we are ready. Now, you're no stranger to constituent services and reaching out and answering. And and I have to compliment you. You were very active on Facebook and the neighborhood Facebook groups responding to concerns and and panicked messages. And people have said about not having electricity or not having water. And, you know, you were I know your office was taking some of that information in and you were in Brenda Stardig's office when she was council member here. So you're no stranger to dealing with constituents and helping constituents out. But were you prepared at all? I mean, you came into office in January of 20 when you were elected. And then we had in March, a few months later, pandemic. And then we had other issues as well. We had concerns about the election. We had and then, you know, we were getting vaccines, but we have the mass quarters, people are upset about that. And then we have now the problem with the winter storm. It seems like there's been a lot of plagues hitting the city of Houston and the nation as well. What were some of the the high points and low points you saw? That you would like to address in the upcoming two years you're on the you're on the council. Well, first of all, you're right. It has been one thing after another after another. Just first coming into office, we started with a bang. Literally, we had the Watson grinding explosion that was about two weeks after taking office. And it's just been one thing after another disaster after disaster. But we're dealing with it. I think my background working for the previous councilmember councilmember started has prepared me working with constituents, as you said earlier. And it's it's been tough. But what we've been trying to do in the district day office is to focus on those things that when all of this is done, there's still going to be those issues that I ran for in the first place to try to fix infrastructure issues, quality of life, crime, those kinds of things that we are trying to solve in district day. And so we are focused on those things and the covid and all these other things have just added to our list. It hasn't taken away from those those core issues that we're trying to address. We've just added added a lot to our plate right now. If if I'm sitting in District I, District H or District C and I've got issues, what can my city representative do? My councilmember representative, what what should I direct toward their office? If I feel that I'm still having problems, not enough water, electricity is still spotty. What should I do? Well, I would suggest that if anyone has any concerns still, and we are still getting concerns into my office to please contact us. It might not be under my director's section, but we can get you to the right place. So even if it's something that has to do with electricity, if it's something on the state level, we can contact, you know, your state representatives on your behalf, make sure you get connected with them. If it's a plumbing issue and you maybe you don't have the funds to pay for it or, you know, you just have concerns about it in some way. Let us help you. Let us get you connected to the right people. We can find organizations most likely that that can assist you with any kind of concern. So while it might not be under my direct jurisdiction, we work very hard in the district day office to connect people to the right places. I take my role as being a public servant very seriously. And so it might not be my role, but it's it's my problem. If it's the problem of my constituents, what were some of the bright things you've seen in the past year as a city council member of things that make you proud of what you're doing and of the district you represent? I am so proud of district A. It has been a tough year for district A. I mean, really for all of Houston, but really for district A as well. And every time something happens, the community comes together and supports each other. And that is district A. That is that is what we do. That's what we've always done, what we continue to do. And I've just seen so many neighbors helping each other, not just with the winter storm, but just in general, even with covid helping on social media, helping people find each other jobs and resources. And just people have really come together to help each other out. We've had so many food distributions, not just from the winter storm, but just because of covid and just water distributions, all kinds of things that people, the community, they've come out to help us with. They have contacted our office. What can we do to help? What can we what what volunteer opportunities do you have? We want to give back and we've seen so many people come and support our community. We recently served almost 5,000 meals this past weekend to the community. That was with Representative Lacey Hull's office as well. She was she helped us so much, put that together and, you know, we served almost 5,000 meals and it wasn't just the two of us. It was so many volunteers who came, neighbors helping each other. It's been it's been tough, but it's also been really wonderful to see everyone come together and I've just been so proud of our community. So if there's any need that you have, contact us. We'll find support for you. That's what we're here for. That's what we do. So please contact us not just in March, but in any month we're here to serve. Well, I really appreciate it. And again, thank you for all the things you did. And as as somebody in your district, I was very impressed the amount of assistance and the visibility you showed. You were always on our neighborhood Facebook pages. And I know you're not the only council member who does that, but you're the one that I was most concerned about because I live in your district where the power was off. People were saying contact Amy's office because you had you had said, let us know if there's anything we can do. And I really appreciate that. One of the things when I get to interview candidates, one of the things that I'm always impressed with, I know a lot of times people complain about government, but our city and local elected representatives, you know, we we really get a good batch of people who really want to serve. And I thank you for being one of those people. Well, thank you. I really appreciate that. Like I said, I take this role as being a public servant very seriously. And I think the way that people are contacting their elected representatives are changing. And that's why we try to use social media as much as possible. And, you know, sometimes we have to ask them to contact their office and get more details on things. But we do try to have a presence there to make sure that anyone knows that they can contact me and I respond myself on social media. So, you know, we're we're just we're here and we're ready to serve no matter how you contact us. Well, thank you again very much. And how did they get in contact with your district office? What's the best way to do when they have questions and problems? Well, if anyone needs to contact us, you can send us an email district A at Houston TX dot gov. Or you can call us eight three two three nine three three zero one zero. We're pretty easy to get a hold of. You can just Google my name, find a way to get a hold of us. We want to hear from you. We're happy to hear from the community. So please do contact us. Member Peck, thank you very much for your time. And thank you for your responsiveness and for all you've done in this last year. It's really been a time that we needed a good city council member. And I thank you for being that person. Thank you so much. I appreciate that. Wind energy is a modern spend on an old way of harnessing energy. Tonight, our guest is Monty Cummings of Energia Veleta, who dropped in to discuss wind energy and its future here in the Lone Star State. OK, Monty Cummings, I want to welcome you to Public Affairs, Public Access on Houston Media Source TV. Thank you very much for being with us. You are with. Energia Veleta, that's actually your company that you started. Tell us a little bit about how you got into wind energy. Well, it was about 20 years ago, Jane, and thank you for the invitation. It's a real pleasure to be here to talk about electricity and renewable energy taxes in Mexico as a professional. I'm a CPA and at one point in time, I had a boutique consulting firm in an oil and gas company, friends and customers of mine asked me how the production tax credit for renewable energy worked under Section 45 D of the Internal Revenue Code. I gave them a brief explanation of how that worked along and presented my consulting invoice along with it. And they said, tell me more. And we kept talking about it and made a couple of presentations to other industry leaders who have also been in Texas and natural gas and electricity are intricately intertwined, which we will talk about a little bit more in this. And because of their activity in the oil and gas patch, we looked at it and decided that developing a wind energy project is very similar to developing an oil and gas prospect. In that you lock up a resource rich laden area to get the rights to develop it, get all your permits and connect up to the export pipeline, as it were, get a customer and generate the energy. So we decided to do that. And our first prospect, we started working on in 2003, was on the Kennedy Ranch just south of Corpus Christi's 400,000 acre ranch founded by Mifflin Kennedy, the mentor to Richard King and the King Ranch, but this is the Kennedy Ranch. And our first one, it developed our first wind energy project. And seven years later, it became operational. The Pinnascar Wind Farm Project in Kennedy County, Texas. That was how I was introduced in by being a CPA. And at that point in time, there also the Texas electrical industry was restructured in 1999 with Senate Bill two, which divided the energy industry from vertically integrated entities to generation companies, transmission companies and load serving entities. And because of that, there was a requirement to purchase a certain percentage of renewable energy in order to be a a load serving entity. And that also was a driver of the start of wind energy in Texas, along with the production tax credit and the requirement of retail energy companies to buy a certain percentage of their electricity from renewable sources. So a lot of the the foundation for wind energy and why it started expanding is based in part on legislative mandate. Correct, the the initial portion of it was a man. Well, you know, if you want to go back further than that, you know, from the federal level, you know, the the Public Utility Act that required load serving entities to buy from any generation source. This was George Bush, also Governor Jerry Brown gave out a tax credit for California State tax, a federal tax or install capacity. So, yes, the impetus started with governmental incentives to promote the use of renewable energies. And the ones we just mentioned about the the the the percentage production requirement in Texas was one that kickstarted the energy industry in Texas, as well as the ERCOT open access nondiscriminatory access range generator that wanted to connect to the electric grid also facilitated the uptake of wind energy in the early 2000s. So you're working on developing projects and have developed projects in South Texas and in the Pacific with Mexico. When I think of wind energy, I always think of West Texas because my wife's from West Texas, we traveled up there a lot and outside of Big Spring, sweet water in that area, there are just rows and rows of windmills. But wind energy is really all over the place. There are mills in windmills in the Gulf, too, right? And in the water, no. But on the Texas Gulf Coast is what I call it's the Napa Valley of wind energy. And I can give you some characteristics that would do that. You know, no doubt about the wind energy in Texas started in West Texas out by Fort Davis, some of the original plants started by Abilene Trent Mesa. The part about the panhandle, which is the windiest part of Texas, really didn't take off until there were transmission lines built to bring that energy from the panhandle to the Lamerilla Lubbockary downstate. Really, the Ercott grid transmission grid used to run about to Roscoe, which is just a little bit northeast of Sweetwater. And beyond that, that was all Southwest Power Pool. Also out towards Fort Stockton close to the Pecos River Valley on Woodward Mountain, King Mountain. Those were the original Texas renewable energy. Now, what happens is that it's windy as there at night and in the winter. And when does everybody need energy is during the summer in the afternoon. And that's the good fortune we had living on the Texas coast. And that's when it's always windy every afternoon, 15, 20 miles an hour, just because the air above the Chihuahuan Desert heats up and rises up. And the cold air from cold in comparison rushes off the Texas Gulf to take the place of that hot air that rises. And that's when we started working on this project in Kennedy County, which is right on the Texas Gulf Coast, which, you know, it's never really too windy. But then again, it's never really to not windy.  There's not it blows from the southeast most of the time. It's sitting on the existing transmission robust transmission grid that not that far distant from Houston, San Antonio, Austin, Rio Grande Valley, where major load centers are. So and there's plenty of wide open flat spaces to put these things. And so South Texas has really come on as the Texas Gulf Coast area as a important when it's to wind energy, what wine is to Napa Valley, what Georgia is for peaches. I want to confess my ignorance here. I really didn't know that much. I mean, I drove by windmills and I know that Texas Tech has a big wind energy management program. But I and probably a lot of other people really don't know how wind energy works. I mean, we know it turns turbines like hydroelectric. But how does energy get into the grid? OK, well, you know, I'll just make this one step back and talk all about just the generation of electricity in and of itself. There is this process called electromagnetic induction, electromagnetic induction, where you run some metal between a couple of magnets and nobody knows why. They just know it does. It generates electricity. And, you know, originally these were gasoline, diesel, coal-fired turbines that spun these turbines at a high rate to make electricity.  Now, with wind energy, it's the same. There's coal plants, you know, as you mentioned, there's hydroelectric plants that the moving water moves a turbine fast enough to where these magnets aren't spinning and create electricity from the electromagnetic induction, coal plants, which boil water in the steam coming off the water, turns the turbine. Same with natural gas plants, same with nuclear plants. Those are three where they're burner tips, where water boils. People call them thermal generation. Hydroelectric is not thermal generation, but natural gas, coal and nuclear are all thermal. Now, the same electromagnetic induction process happens with the wind energy. As the blades start turning, they run through a gearbox, a planetary gearbox, which takes the revolution of 20 revolutions per minute and runs it up to 3400 revolutions per minute and creates electricity. The electricity, just like that, once the electron is in the wire, all right, it's no different than an electron from natural gas, nuclear, or any other source, and it gets collected and distributed in the same manner. And it's generated by the same electromagnetic induction fueled by the kinetic energy of the wind and these blades, catching the wind, spinning it and then running through a gearbox to make it up to high speed, turbine, electric generation speeds. Now, that's how it works. Now, unlike other thermal, it's not as easy to control. You know, it's becoming easier to predict, but it's not as it's not. There's no on and off switch when it's it's when it's spinning and generating electricity, you want to take it. And that's the other thing about electricity. It's you make it about the same time you use it. There's no really economical way to store electricity at scale. Of course, there's batteries and we've made great improvements in battery technology for automobiles, for cell phones, but enough storage and a battery to power a city. We're just not there yet. And that's where hydroelectric facilities come in. In a sense, they're a battery storage in that when you don't let the water lose, you know, there's your storage facilities in hydro. So and just because of the nature of Texas, if you driven out to Lubbock, you know, we don't have much water, so there's not going to be. There is hydro, but it's not a significant contributor to the Texas electric grid. So the you had mentioned earlier, and I think you're coming back to this, is that a lot of the energy generation, whether it be nuclear, gas, carbon, water or solar, it works in there integratively, I guess, in an integrated method. And sometimes sun isn't available, sometimes wind is not available. Sometimes water can be stored. And as you mentioned, there's no batteries. How do you foresee the near future of wind energy contributing? Well, you know, I think we take a look at, you know, knowing your orientation towards history to take a look at where we've come from. We'll give you a good idea of where we think we're going to be going. You know, Texas, as it stands right now, if you just want to focus on Texas is the eighth largest wind. If it were another country, which some people seem like to think it could and should be, it would be the eighth largest wind energy country in the world. You know, there's US, China.  More than this is Texas alone. Texas, if it was another country, has more wind energy than, you know, 180 other countries. If you it's it's it would be the eighth largest wind energy installed capacity market in the world. Now, that's only going to continue. Why? Because it's the cheapest. You know, there's no the only cost you have in ongoing for wind energy is property taxes. You know, all your fuel costs, essentially the same with solar, all your fuel costs over the life of the project, you're investing in a capital cost upfront. You know, I've participated in auction processes competing against any one any any generation source, come one, come all. And wind energy and solar are the cheapest forms of energy right now. Now, that's great. But, you know, you don't build a system out of completely out of wind energy. One of the things that wind energy helped during our recent pull of vortex is that the diversity of the geography and geography of the system, Texas Gulf Coast wind kept contributing a significant amount of energy during that whole. So we would have been in worse shape had we not had wind energy where we think we're going to go, you know, certainly as a switch is made to low carbon sources, wind power will have an increasingly solar. What's one of the challenges of wind power is that it doesn't work well at the distributed level, meaning home energy out in the panhandle. They used to have wind chargers back before the Rural Electric Act came in, but using distributed generation on your home, I think that's going to be another area that we're going to need to take a serious look at, certainly increasing demand response and winterizing our homes has another role to play to reduce the energy. The reason why the energy demand was so high recently in the pull of vortex is that our homes here in Texas are just not built with the proper insulation to survive subzero temperatures for days at a time. So, I mean, yes, there is a patchwork of both generation resources, transmission upgrades, insulation of our residences and businesses that's all going to contribute into the transition to a lower carbon future, even including electric vehicles. So, you know, you're mentioning about it's not really effective on an individual basis. And I, you know, there's a little house that I think it may be a farm that I pass on the way to Lubbock from time to time. And I think it's outside of Pumpkin Center. And there's a big, well, not a big, but a good size windmill out there, kind of like the ones behind you. And I guess it powers their business or their home. But as you're saying, it's not good. It's not cost effective for just an individual, right? Well, you know, I can give you examples of school districts that have put wind turbines at their facilities. Shallow water school district, by Abilene, there's another one. And, you know, it's good for generating the cheapest amount of energy when it's windy. Now, whether that's going to be 100 percent of your energy usage. No, you're going to have to have to supplement it with solar. You're going to have to have to supplement it with natural gas. You're going to have to say that it's going to take a balanced portfolio of generation to not only provide for the cheapest energy, but also reliable energy and cheap and reliable. Many times are at opposition. You know, that's one of the problems with the Texas grid we recently experienced. Texas is great for making cheap energy. It's the cheap energy capital of North America. Now you want cheap natural gas? We got it. You want cheap wind? We got it. One of the reasons why is that the increased capital requirements needed to winterize or weatherize wind turbines, gas pipelines, coal fire plants, nuclear fire plants were not made in the interest of keeping the energy cheap. Now, as a result, we have a Harvey like catastrophe with the cascading failure of natural gas pipelines. Gas generation facilities, wind turbines, nuclear facilities, water pumping stations that run off of electricity. All of those combined, you know, people are saying this, the after effects of the polar vortex freeze is going to be more costly than Hurricane Harvey. So it's kind of a, you know, you want to pay me now. You want to pay me later. You know, we didn't do the pay me now on requiring wind turbines to have the de icing package. We didn't require the installation of well head freeze protections that that's where a lot of the natural gas got froze up. It's because the water comes up with the natural gas and freezing doesn't run down the pipeline. You know, we didn't require heating controls on feeder systems of the nuclear power plant. You know, it was cloudy and there was no sun. And everybody didn't have a their home insulated and had to turn the heating the way up. And we had the crash. So and now we're going to be paying the bill for not making those investments on the front end. So, you know, it was kind of a planning decision as in the interest of making the cheapest energy possible, which we were great at and Texas, you know, benefited greatly from industry growth, job creation, from having the cheapest energy. But now we're paying the price with the catastrophe catastrophic fall from the cascading failure of systems as a result of the polar vortex. You bring up some issues. In the discussion, and it reminds me of a lot of things that I see and hear on social media or from people who are talking about wind energy. It is cheap. But let me ask you let me ask you the the question that I see all the time. How many birds do these windmills kill? Much less than all the hunters in Texas combined. OK. You know, I've worked in this particular issue for more than 20 years. Our first wind energy facility was in along Baffin Bay, along the Laguna Madre, which is on the Central Flyway and at a choke point on the Central Flyway of all the migratory birds that come from Central US, East Coast US and winter in the tropics and are on the winter flyway on the way back. So we 80 percent of North American redhead ducks overwinners along the Laguna Madre. So in order to respond to that concern, you know, we mounted one of the most ambitious pre-construction avian mortality monitoring programs, we used radar, we used recording devices, hundreds of hours of biologists in the field. And using their field collected data and observation records applying the biostatistical techniques used there, they came up with the estimate that the wind farm in Kennedy County would kill two point some odd birds per year per turbine. And there are 300 turbines there. So there would be 600 bird deaths because of that. Now, as a follow on to that, we went on and continued a post-construction mortality monitoring program, which actually took the predictions and compared it to the actual results. One of the innovations being Texas, that we usually that field work is done by biologists. So they go out and look for bird carcasses around the bottom of the turbines. And and we found that bird dogs are much more reliable than biologists in finding bird carcasses, you know, and there's certain techniques of measuring predation and search your efficiency. That's where the bird dogs, because we would go out and see them and know that, you know, that there's a dead bird there. And did the biologists find it? No, did the bird dog find it? Yes. And the results of that almost mirrored the projections. Certainly, there are areas where, you know, there are species of concern. The prairie chicken up in the central flyway is one of concern. The the the bad rap, shall we say, started in California in Hawthorne and the Tahatchipi area, where as wind energy first started out, the towers were latticework towers and the turbines were of a small capacity, meaning that they the blades rotated at a very, very high speed. The Golden Condor native to the area thought those latticework towers for that the turbines were placed upon were a great place to make a nest. And as they're sitting there watching the rabbit run below the wind turbine, they take off and get hit by that blade that's spinning 300 revolutions per minute. So, I mean, there are certain areas that, you know, need to have extra precautions and developing in a responsible way. And I think at least in our Kennedy County, which is the absolute most sensitive area we've ever developed a wind project and I've done more than my share is is a shiny example of how you can do responsible. We also installed there a radar detection unit, a Merlin radar detection unit, much like they have at airports because jet engines and airports have the same effect on flying mammals, as they say. And as an incident or a flock of birds is detected on the radar units, they shut the turbines down. Bats is also an area of concern. And it's found that that's really not an impact issue. That's more of a low pressure issue in that they're they fly into a low pressure and their heads will explode. Now, the so I really don't. So birds is something that you need to take into consideration. You need to do your due diligence. And if you prepare the proper amount of stays and show that you're not going to have any negative impacts, well, then go right ahead and we and that's what we did. And that's how our pioneering pioneering work. There was followed by many other people to establish the other wind farms are along the Texas Gulf Coast. What do you see on the horizons? Changes are going to come about as a result of Winter Storm, Uri. OK, well, you know, first of all, on a broader perspective, I would think that we would need to anticipate that the Texas grid has been designed for extreme heat events and was not designed for extreme cold events. I would think that that needs to be brought into the planning and consideration of it. And that includes additional investment to to allow for those types of resources to be more available when we need them, which will require investment. So the first thing is, is to recognize that climate change is upon us now. We're seeing the effects of it and that, you know, denial of that was only going to continue our path down. Repeat the the the the the the mistakes and planning. We made this go around, you know, communication is another one. Certainly when Hurricane Harvey started scraping up the Texas coast, you know, every emergency management office, every elected official, every county judge was beaming out warnings of what's going to be coming.  And in this, I mean, you know, everybody was happy, happy Valentine's Day and the lights went out. You know, there was certainly no coordinated preview, emergency management notification of this. So that's certainly another area and figuring out adjustments to the electric market to allow for recovery of investment in these winterization necessities in order to survive completely another. Thank you for putting in Yuri that even sounds Russian. It's almost you're one of the Yuri, you've got a Javago, right? I mean, it's it's fitting. I mean, Dr. Javago was filmed in the cold and so were we. You know, so certainly market structures, other markets have a capacity payment where generators are paid just to be ready. And if they're not ready, there's a severe penalty. So the energy that needs to be looked at. Yeah, so those would be the three things that I would suggest. One is to integrate climate change into the planning horizon. Second, you know, have, you know, governmental entities be more aware of this and allow for market reforms in order for the investment to to in capital costs to winterize all forms of energy. You know, coal piles froze over nuclear plant of one of our four nuclear plants that have shut down because of one of the water feed system controls froze up. So and, you know, wind energy certainly could have done better, but so could have everybody else. And that's why we need to focus on what can we do better to do this and let's don't get caught with this being unexpected and let the public know what's going on. And your program here is a vital step in educating folks, bringing in keeping the discussion going as to what we need to do to have a carbon free grid as well as provide the reliability that we need for an ever increasing dependence upon electricity that our modern society has. You very much. And I appreciate you taking time to visit with us. My pleasure, Jean. Can I move any much? Thank you. Our final guest tonight is Dr. Gavin Dillingham with the Houston Advanced Research Center, Hark. And we'll ask him about clean energy and energy diversification in Texas. Tell us a little bit about that organization and what you do there. Sure. So the Hark Houston Advanced Research Center was founded in 1982. George Mitchell founded it as he was starting up the woodlands. He wanted to create kind of a research hub up in the woodlands and really wanted to have a focus on sustainability around that. He so he started Hark at that point. And at that time, we focused a lot more on kind of hard sciences and engineering. We actually housed some of the scientists who were working on the super collider up around Waxahatchee, had a fuel cell lab, did all sorts of just kind of highly technical R&D kind of work over the last started about 2000 or so. Hark switched to much more of an environmental and sustainability kind of focus and since then has been working on air, energy and water issues. So we have folks that focus on, you know, scientists that focus on air quality. Water scientists focusing on water, water availability, water quality to do a lot of work in the Gulf Coast and then just kind of the surrounding counties dealing in those issues as well as with ecosystem services and also and especially in the last few years, focusing more on stormwater management, flood risk mitigation type work. I lead the clean energy group. So I direct that group and there's a number of us there. And we focus on both kind of energy efficiency work as well as grid resilience, distributed energy resources. A lot of our work right now is with the Department of Energy where we do run about three programs now with them, providing technical assistance for things such as micro grids, developing different types of decision tools, looking at solar plus storage and low income communities and trying to figure out business models around that. But we do a good bit of work just kind of in both the energy efficiency and resilience space. We also work with cities and counties on climate action planning type stuff. So we've we've put together a few of those and helped the city launch their and actually wrote the city of Houston's Climate Action Plan for them there. So across a variety of different sustainability and climate focused areas at this time. These questions about clean air, about energy, about stormwater and about how Houston and other growing areas are going to deal with that become more and more important to the public at large. Yeah. Oh, absolutely. And we're seeing a significant trend in that area as far as, you know, just, you know, and I think, you know, we're seeing it both from the, you know, from just residents as well as organizations, companies, corporations within within the region. You know, after Hurricane Harvey, there was, you know, much of that recovery had to happen. But there was also a lot of question of what do we need to do with our infrastructure to improve its resilience to reduce the likelihood of flooding, because for some companies, or, you know, especially these some of these large global energy companies, there were discussions about concerns about recruiting and recruiting and retaining, you know, high quality, you know, knowledge workers and kind of recruiting younger workers to come work in the industry and such. And so, you know, there's very much, you know, as we're seeing, you know, changes in the number of events and the intensity of events, if it's hurricanes or flooding or extreme heat or those types of issues, there's very much a growing interest in that regard of how do we mitigate that risk and make Houston and the region in general, just, you know, improve its quality of life, make sure it's, you know, has, you know, that sustainability associated with it, make sure it's an attractive place to come and live and work in such. And so, yeah, it's very much on people's minds, and it's very much how do we start, you know, continuing to deal with these ongoing, you know, extreme weather events that seem to be happening on a more regular basis. There's ways in which we can reduce that and how do we start putting the investment in place to do that? Well, one of the weather events that is on everybody's mind right now is the question of a winter storm, Yuri. And, you know, we're just recovering from that. People are getting their electricity back. And people are asking questions. The legislature has met recently to look into the energy grid, ERCOT. Can you inform, like most people, I think, a lot of this is new information to us, and we don't know, you know, what we're hearing. We may not understand it fully. So can you explain a little bit about ERCOT and what that is and how it was formed? Sure. So ERCOT is what's called an independent system operator. And it's a quasi-governmental organization that was formed by the Public Utility Commission of Texas. And their primary goal is to schedule electricity to come onto the grid and to get it to the right location. So they're largely a scheduler in that regard. They do go out and make sure that, you know, that energy or generators are producing the power they need to produce, making sure there's enough power on the grid, and then making sure it gets routed to the right locations and such. But they're one piece of a very, very, you know, kind of large system here. So, you know, you have the state, you know, the governor and the legislature, they largely put together the rules that goes down to the Public Utility Commission of Texas. The PUC then puts together, you know, they work on the implementation of some of those rules as well as, you know, continue to add to them or make the appropriate regulatory changes and stuff. And then ERCOT, you know, reports to the Public Utility Commission there. And ERCOT works pretty much with the large ecosystem of different types of companies out there, especially when you look at ERCOT within the deregulated market context. And so within the state of Texas, you have, you know, part of the market's regulated, part of it's deregulated. ERCOT's responsible for the deregulated part of the state. And that's about 85 to 90 percent of the electricity use in the state. The other non or the other regulated sections would be actually in the woodlands, kind of the northern part of the woodlands, which is Intergy. Austin has Austin Energy, there's CPS and San Antonio, and then there's El Paso Electric and El Paso. Those are all regulated and have a bit different rules. Some of them still interact in the ERCOT market, but it's slightly different. So ERCOT's largely responsible for the deregulated market there. They work what's called Transmission Distribution Utilities. Those are like your center points for your Encore or your AEPs that are out there. And their responsibility is just the transmission distribution system. They get their power from the generators that are out there. The generators are independent power producers. They're large organizations such as Vistra or NRG or Calpine, or, you know, both on the thermoelectric side or on the wind and solar side of things, large utility scale systems. And so those generators produce the power that gets placed on the transmission distribution grid. The transmission distribution utilities get the power to the customers. And then also in the deregulated market, you have the retail electricity providers. They're the one that's buying the power on behalf of the customer. And they're kind of that liaison within that. So you have a lot of different pieces and parts working together in this regard, and there's actually, you can dive deeper into that of other entities, but at the high level, kind of the different pieces that are going on in that market. So with the League of Women Voters in this show, what we try to do is educate the public so that we can be better informed voters. And one of the things that I've seen recently is a lot of finger pointing. And so let me ask you, as someone who studies this, what goddess in trouble during Winter Storm Yuri? I'm not used to saying Winter Storm here in Houston. What got us to the point where we were? Right. It's great. I keep calling it Tropical Storm or Hurricane too. I mean, because we're so used to those versus Winter Storms. It was such a long one. So yeah, it's kind of the nature of the market that we're in right here. It's the ERCOT market or just the deregulated markets very much focused on providing the lowest cost energy. And what that means is that there's a focus on the lowest cost energy being provided to the grid and reliability. And that works great whenever there's blue sky conditions and everything's kind of within your conditions of operation there. It's not a grid that's designed for a tremendous amount of resilience. And that is just based on the nature of how the market was designed. There's no incentive necessarily to do what people have been talking about as far as the winterization or the weatherization of the grid here. And the reason for that is any kind of major changes you make to these, to if it's a wind turbine or if it's a natural gas plant or a coal plant or nuclear or solar, any kind of winterization or weatherization you do adds cost to that. And it makes them less competitive in the market. So there's no incentive necessarily to add these types of components to any kind of generator there. There's also aren't any resilience standards put in place and that would be the public utility commission that would have to come up with the resilience standards and enforce those. Those standards aren't put in place either because they just, once again, it adds to cost to the market, to the ability to produce this power at the cheapest rate. And it's wonderful. And Texas sells itself on low regulations and low cost of energy. And that works out wonderfully until you have these types of events hit us. And that starts showing the vulnerability of that type of approach. And so there needs to be efforts made and that's where this discussion is going right now of how do you incentivize some of this weatherization and winterization to happen within these plants in order to reduce the likelihood of this happening. And a lot of that really depends on some of the trade-offs. The grid has largely developed, the ERCOT system or just Texas system in general is developed to deal with extreme heat, deal with hot summer temperatures. That's what we typically find. And so the natural gas plants are not stuck within a structure. They're not housed in any way. They're out in the open and that's largely to help them with cooling. You add any kind of technology to the wind turbines that potentially could make them be able to sustain very cold temperatures, but it may make them less efficient during the hot summer periods and such. And so you're dealing with that trade-off and with that balance there. And so one of the other issues that we see is that when you look at the long-term system assessment, which is the kind of the planning that ERCOT does to look at what is future demand and what does future generation look like across the state? And this is what happens with what's called integrated resource planning in other states or just energy planning in general, is that traditionally they look at historical weather data. So they look back 20 years. Okay, this is 20 years with a pattern of weather patterns here and they projected ahead 20 years. And they said, okay, we're assuming that the weather is gonna continue to look like this. We'll throw some contingencies in there. We'll say, oh, what if there's a 2011 drought or whatever is this and whatever is that? And how will the system perform in that regard? What we're seeing now and what we study at HARK and we have a few scientists working on this is more looking at downscaled climate data. So we're looking at these grids, this very granular data that can look at about a seven kilometer by seven kilometer type grid here. And this has been working with actually with Texas Tech Climate Sciences Center to get this data. And we're looking at, okay, so we really know that previous weather patterns are not gonna be reflected in future weather patterns. That we're pretty certain on what that looks like and the trends are showing that direction. We're seeing a lot more intensity of these types of events, whether it's hurricanes or flooding or drought or extreme heat, we're seeing that tendency there. So we know that we need to look at different types of data. And so we're starting to look at these climate models more closely and looking at the impacts on the power generation systems. So if you have a natural gas plant or a coal plant, and some of the biggest concerns in Texas, although a lot of the discussions around winter, the winter storm, is really more on extreme heat and water availability and water temperature to cool these thermoelectric power plants and allow them to operate over time. And so now we can start using this downscaled climate data and say, okay, so out in the next five, 10, 15, 20 years, this is the likelihood that we're gonna be seeing a drought or we're gonna be seeing this extreme heat event. And this is how intense and potentially how long-lasting it's gonna lack. So it allows these planners to start running scenarios. It allows them to kind of see, okay, what are my options under these different scenarios? And you make decisions based on that. Right now, none of that is happening within ERCOT at all. And you end up developing your system and developing your plants and your market in a way that does not take into account any of that future risk. And that becomes problematic, especially as we see these changing weather events and weather patterns. Well, Dr. Gavin Dillingham, I want to thank you very much for your time and for your thought-provoking responses. I mean, given us a lot to think about. Absolutely, it was wonderful talking with you today. So thank you, Jim. Thank you. I want to thank our special guests on tonight's show, Houston City Council member Amy Peck, Monty Cummings of Interhenje of Aletha and Harks, Dr. Gavin Dillingham for telling us about how the city fared during the recent winter storm and about the future of energy here in Texas. And a big thank you to you for joining us tonight on Public Affairs Public Access show on Houston Media Source TV. I'm Gene Preuss for the Houston League of Women Voters. Have a good evening.


The Lost History channel has now migrated to the alternative video-sharing platform Odyssey. You can now catch up with our most recent content on Odyssey, where we have already managed to lure around 2,000 subscribers to our channel. And although we still maintain our presence on YouTube for the time being, we simply have to try to adapt to the horrific changes YouTube has dangerously implemented across the board and this means attempting to survive. On Odyssey, we'll see our most recent content just like you do on YouTube. We aren't leaving YouTube, but we are branching out and for most users, Odyssey will simply be a place where they can find great videos just like you do on YouTube. YouTube has taken exception over the past two years to content creators like us and there are now some well-known drawbacks of staying wholly on YouTube, especially for people whose material is perceived as not being advertiser friendly or falling short of other policies that are subject to constant change. This and a mixture of creator-supported negligence has almost crippled our channel. Only this week, our content was again wrongly flagged as having broken one of these policies before being restored to our backup channel, Light Up the Dark. Odyssey aims to be an alternative site for migrating creators like ourselves, allowing us to publish content and interact on the platform directly without the risk of demonetization or termination, both of which the Lost History channel has fallen victim to in years past. Everything built to power Odyssey is open source and designed to be controlled by the public at large, so it's a decentralized platform. Hundreds of developers have contributed to the core code bases that power the platform and thousands of other community members have helped in other ways. Content creators like us performing translations, making graphics and so much more. If it all pays off then the future could prove much brighter for content creators who have suffered enough on YouTube with too much uncertainty and the rug always being pulled out from under our feet. So join us on Odyssey and help us keep our options open. Together we can survive.


Yeah, thanks everyone for coming as Josh said we're going to be talking about building an API with GraphQL for So who am I? Probably everyone most of you know I'm Adam one of the development leads at previous next You see me on slack and On dripple.org as AC Bramley Today we're going to cover how to kickstart your GraphQL API How do you write write your own data producers? How to write secure mutations to update create and delete content on your site and as we go through this stuff There's going to be live demos of how we integrated all this stuff into our react apps And just a little side note. I was born and raised in Wellington So it's pretty amazing to be speaking here and be back and and seeing all your lovely people. So First up what actually is graph QL? This quote is from graphql.org graph QL is a query language for APIs and A runtime for fulfilling those queries with your existing data so QL is query language and Graph is actually just referring to the way we're modeling our data So it easily maps to real-world data and mental models about how our business domain is defined So we define it as schema which similar to like object-oriented programming can kind of just be thought of as a Collection of types or classes and those reference other types and then those reference other types and so on and so forth So our schema sort of defines the interface and then we have a freed the freedom to implement the back end however we like So an example of a schema for something that we're actually going to talk about later We've got a resource.  Some of those fields are referencing other types which have their own fields so on and so forth and What's really nice about graph QL is you can get all of this information in a single query really nicely structured So here's an example of Give me a resource with this UUID Give me all this information and then you get this really nice Jason Response back and you can really easily traverse everything And we'll go through more of this stuff in a little bit But oh so yep, so for this presentation I'm going to talk about what our main use case for graph QR was I say main in princess because we this is the first thing we use it for We ended up using it for basically everything else on the website because we loved it so much If anyone saw my talk last year at Drupal South Brisbane On open search this stuff is based on the same project as that was so you might see some familiar design elements and so forth So what was the actual feature? Well the client wanted us to add an a save Option to content on the website So being able to save resources to what we call a collection in this case resources Were just different content types one is literally called resource, but there was a bunch of other ones So we needed to be able to save a resource With that with this heart icon on a on a page The icon needs to show the status whether the page is saved or not And then when you save or unsave something it needs to update on the fly You needed to be able to save a resource to one or more collections through a modal UI like this You need to be able to create new collections as you're saving content content to collections And of course you need to be able to see your save resources and manage those resources and collections as well In this scenario collections are specific to a user So the user owns the collection. They're the only one that can view it and manage it and so forth Except there was also a feature that needed to be able to share a collection So a user should be able to toggle on link sharing and then they can share that collection with the public In Drupal this was just pretty simple access control stuff, but We'll talk about how we actually built all of that to begin with You might be wondering why don't we just use JSON API and we actually did The first sort of proof of concept for this feature was using JSON API It just didn't turn out that great and we had to do a lot of manual stuff to get it working We thought screw it why not try graphql It was a new sort of bleeding edge project anyway. Let's give graphql ago So as an example of one reason we didn't really like JSON API was if you've worked with JSON API You'll be well and familiar with something the payloads that it sends back Can be pretty hard to manage in your front-end There's a lot of data normalization that you've usually got to do Especially when it comes to things like query caching making react react your act react apps nice and snappy Jason API was just very difficult to work with whereas graphql exactly the same data Very much very easy to read and understand what's going on for both your developers and your software We also found that creating and updating operations were quite a lot more cumbersome with JSON API We needed to write a lot of access controls around You know making sure people can't create collections for other users So on and so forth again lots of manual data manipulation in the front-end to make things more manageable And it became really hard to keep track and keep data in sync with case like query cases and Things like that with the responses coming back from Jason API and I'll cover that a little bit more again in a bit So to LDR Jason API is a really powerful tool out of the box But it's sort of this broad largely undefined API that you just got to figure out how to use Whereas graphql requires much more upfront development time for your especially for your back-end developers But it just pays off and dividends later down the track So into the graphql module on Drupal org. We're using the graphql 4 module as a put in my slides The difference between graphql 4 and 3 is Graphql 3 version 3 shipped with a lot of things out of the box that defined Schema and all that sort of thing for you Whereas graphql 4 is more of a really a toolkit to empower your developers to design the API really from the ground up a Lot of that automation schema stuff like that has been moved to the graphql compose module I believe I haven't used that though So check that out if you need to Cool, so let's actually get started into some graphql stuff. So You'll spend most of your time working in the back-end anyway working with your schemers and schema extensions This get book by the way I've got to mention it in the last slide is an awesome piece of documentation that covers all these concepts and a lot more and Yeah, highly recommend you'd use that for for further information as I said though We're gonna start with schema and schema extensions So your schema is actually just a PHP plug-in in your code Literally just looks like that. You don't actually have to implement anything This is just what you're tying all of your schema extensions to and what you're configuring In your graphql server. What it's what's called in the Drupal UI So when you're creating a graphql server You define what schema it's tied to and then you enable all of these schema extensions And we're going to talk very very in-depth about these schema extensions because they're probably the hardest thing to Wrap your head around When you're building one of these API's with this module So first up we need some graphql schema. So We this is for again saving those resources to a collection So this is our example of our collection schema So if we look at the collection type got a bunch of pretty regular fields Then we've got things like the owner which is referencing another type, which is an author That's another graphql type that has his own attributes so on and so forth The the most interesting one is this items field Which is another type that we've defined at the top, which is actually what graphql considers a union type And that's just a union of a bunch of other types. We've already defined in our code base as well Then we've got this collection list, which is going to be the type of data we get back from when we're querying for a list of collections and Yeah, we're going to demo that in a sec So it's sort of connecting the dots a little bit You've got this collection extension dot base dot graphql file that goes in your graphql folder in your custom module Then you've got all your schema extension plugins underneath a plugin directory Inside those schema extensions is where all your code lives that is tying your graphql schema to how that field is then resolved in Drupal and Hope you're ready because We're really going to get into it now So a schema extension is really as I said how you're defining How graphql is resolving the fields on each of your types? We opted to go with a extension per type Although there are like common Some common types like the author or the term where you've just got you know a simple name and ID And we stick that in sort of a common extension Plugin All of our extensions extend a schema base Class which I'll go over again in a minute, but basically when you implement one of these schema extensions your You're implementing this function called register resolvers, and that's where all your logic lives about how Drupal needs to resolve each of your fields for your type for your given type So let's have a look at what one of those might look like So this is probably One of the easier Well, it is probably the easiest Example that I could find in our code base and even this is pretty hard to wrap your head around when you see it for the first time So I'm going to try my best to explain all this to you But obviously if you have any more questions after this feel free to come up to me and pick my brain But basically for every field on every single one of your schema types You need to call this registry add field resolvers the registry object is passed into your schema extension and This ad field resolver Function is basically saying hey GraphQL. This is how you for the collection type For the field for the ID field. This is how you resolve the value of that field So this ad field resolver function takes three arguments the type The the field and then this resolver which is really the meat and potatoes and how the field is actually mapped So let's dive into that particular thing even further So this is where the naming for things gets pretty confusing the builder object is just something you construct in Your register resolvers function. It's just comes from the GraphQL module But what we're saying here is We're saying for the builder produce me a Entity UID data producer proxy. So the produce function is a factory method for returning a data producer Data producers are explained in much more detail in the handbook But other producers are basically input output functions that say you've got this Entity in this case Give me the result So produce is giving us a factory of a Sorry, it's a factory function for a data producer proxy We're asking for the entity UID data producer and then we need to tell GraphQL how to or the GraphQL module how to map each parameter on that data producer So in this case the data producer has one Parameter for its result function, which is entity and we're saying map that to this builder from parent Which is basically a magic method of saying give me the parent entity or when we're in the context of Composition it gives you the result from the previous data producer, which will also cover soon So breaking that down even further to really try and understand this because this is honestly Probably one of the hardest things to wrap your head around when you're building an API with GraphQL We're getting the parent value We're getting this data producer proxy object and we're saying hey this is how you map the entity parameter in that data producer and Then we're adding that For our collection type for the ID field So this is what the entity UID data producer looks like this comes with the GraphQL module and with a whole lot more As you see we've got an entity parameter. That's what we're mapping all it's doing is outputting a UID So that's one example of how to map a field Now the example for the name very similar We've got an entity label data producer and we're mapping that to the name field for the collection type Hopefully I explained that in enough detail that it's starting to make sense And this is what you can kind of do with that data right you can get the name and the ID for a given collection Quickly covering the schema extension basis So we basically implemented like a base class which all of our schemas extend from I highly recommend doing this for really simple fields like ID title author created updated date It's just really going to reduce the duplication through all of your schema extensions And make things a little bit more manageable Okay, let's get a little bit more complex so There's also an idea of data producer composition so you can compose multiple Data producers together to refine your data even further So this means you can write really generic data producers that do really specific things like their entity UID and then you chain them together for Really powerful field manipulation So we take a look at an example here We want in this case. We're mapping a field that we want the absolute your relevant entity for So we're saying we're using the builder compose function up the top And that just takes a arbitrary list of arguments each one of those arguments is of course a data producer So we're using the the builder produce function again in this case We're using the entity URL data producer which again is shipped with GraphQL and we're saying for the entity URL Data producer map the entity property for the builder from parent again Which is going to give us our collection entity and then map the options parameter to a hard-coded value Which is just setting the URL to absolute You need to use this builder from value function here to actually pass a hard-coded value. You can't just pass the array That's just telling GraphQL how to resolve that that field again that parameter and then we're composing that with the URL path Data producer because we obviously can't return a URL object in our GraphQL response. We want a string So we're composing that with URL path and saying map the URL property for URL path to the parent Which is going to be the result of the previous data producer You can kind of think that of this is like a migrate process plugin pipeline We've got a bunch of plugins that do very specific things and you chain them together to get what you need The URL path one does other things like cacheful metadata bubbling and all that nice stuff for us So, yeah, super super handy this this idea of composition as well Cool, so we've discussed your schema how to resolve your fields now We're going to get into actually how to create read update and delete your data Going back to that that first very first example we talked about with saving resources to collections So let's start with read always the easiest one, right? So first we have to define our schema again in this case. We're defining two different query types We're saying for a single collection. We can query that by an ID and For mold getting multiple collections. We need to In this case get a list of collections for a given user Which is the owner parameter and then we've got some pagination options there as well So then again, we've got a wire that up with a field resolver In this case the type is query and the I the field that we're we're resolving is in this case the collection Query which is what we define in our schema before and Then we're using these awesome magic data producers to say in this case We're using entity load by UUID, which is again shipped with the GraphQL module And we're saying map the type parameter, which is the entity type ID to this hard-coded value And then we're using we're mapping the UUID parameter to this builder from argument So that's going to take the ID argument from our query pass it into the entity loaded by UUID data producer and return our collection objects in our case That's going to then resolve to the collection type and then as we I'm going to see in a moment. We can then query all the fields on that Just by all that schema. We've defined before a little bit more complex with the listing collections by owner So this is a custom data producer that we had to write because obviously GraphQL I doesn't know we need to be able to load collections by a user to write this ourselves But this is where you can get and start to see the power of all these data producers and and how everything's resolved together We could just say map the owner argument to the owner parameter in our data producer and then load our user object in our custom data producer But we're actually going to take it a step further and say why don't you just load that object for me and give me the loaded User object which is what this kind of middle chunk here is doing it saying again use the entity load by UUID for Data producer take the owner argument from the query And I'm going to get a actual loaded user object in my data producer and then just map the other two They don't really matter that much So this is our actual data producer This is so when you use it when you're writing a data producer You know you've got the class and the plug-in definition, but you only actually have to implement one function Which is resolve and as you can see right at the top We've got the owner as an object rather than a UUID, so we don't have to load it manually And then we do all of our querying we add our cache data metadata and then we return this query connection object Which is again provided by the GraphQL module and all that does is does some fancy Deferred loading and things that I'm not going to pretend to understand But it works very well All right, so we got all that out of the way, and we're going to do a little bit of a live demo So we're going to pray to the demo go on Do this? This is going to be very tricky. I didn't think about this, but Okay, so this is an example when you install the GraphQL module and you set up your server You get this Explorer tab and that gives you a GraphQL a graph IQL interface where you can you know debug Your queries your mutations and everything like that. So this is running that collection query I'm saying give me the ID and the name for this collect for this UUID If I go over here, I can see I've got the owner and I can ask for the name of the owner as well And that's going to give me back the loaded user object Okay, I'm going to have to really really speed up because this is going to and Okay, we'll just we'll just leave it. Oh god. This is a terrible idea Shit, I'm just going to do this and then we're going to wing it. All right. So creating This is using something called mutations in GraphQL It's really just a fancy term It's nothing too special. It's all set up basically the same So we start with our schema. We've got input and output now and then we define this mutation type We're calling it create collection in this case and then mapping the the input and output Then again, we need a data producer. So in this case, we're going to get a name and a description we're going to do some validation and we're going to save the entity and Then return that saved entity then we need to wire it all up So again, we're using this field resolver the type in this case now is mutation The ID is what we define in our schema and then we're going to use our custom data producer and map The values using this kind of fancy little anonymous function All that does is takes an array of data and returns the value for a given key So what about that validation that I kind of skipped over? Well, again, there's a page on that in the get book However, we do it a little bit differently So the first Yeah, there's a few ways to do it. So the first way is sort of following the The conventions in the get book where you sort of set up this Collection response object and then you can do, you know access control Stuff like that and add this violation using this ad violation method So our collection response is just a class that extends a response class in the GraphQL module Next you could just literally return an array of errors that kind of works as well What we actually like to do though is throw exception So the user error exception is a game ship with the GraphQL module and it's considered client safe So the error messages in these exceptions are going to make their way to the front end And then you can actually expose those messages to your user. So you've got nice meaningful errors when things When your validation fails The main reason why I really like this approach is because your front-end components actually know there's been a problem in your mutation So we use the tan stack query library Which is yeah unreal. It's amazing. We use that ships with this use mutation hook Which is a react hook for firing off a mutation In the first two examples of validation that error Boolean that is returned from user mutation. That's going to be false if your validation fails, whatever reason Don't ask me why also on error is not going to be called It's going to basically go go into your on success callback every time Even if you've thrown errors or returned errors in your GraphQL code if you're using throwing exceptions your Your request is still going to return a 200 but you're going to actually get an error Boolean back You're going to it's going to call that on error callback. So you've got a lot more a lot easier separation of concerns And you know you can do nicer things Like this. I'm so glad I recorded this one Because we're not doing any more live demos because that was a train wreck So we've got validation to say hey, you're only allowed to create a hundred collections If someone goes to try and create another one. No, sorry. You can't do that We can display a nice error message. We can get rid of the modal That sort of thing. That's just one thing you can do with validation So update I'm going to smash through this again We've got this is for toggling that shareability of a of a collection again.  We're doing validation again We're just setting a property on the entity and we're saving it and returning it again And then you add your field resolver, which is very similar to before and Finally delete Yeah, basically the same thing right you get your schema. Yeah, yeah field resolvers and Yeah, you're stuffing. Yes your data producer So I trust you've got it by now All right, and then we could probably do a super quick little demo Of the whole thing so we we didn't actually get to showing like okay saving a resource to a collection so And in this tab, I'm just logged in as a normal user. So this is the mentally healthy workplaces website This is my local environment obviously as a member of the public you can go and sign up to and Create an account on this website the URL is beta dot mentally healthy workplaces dot gov.ru Or just search mentally healthy workplaces and it will come up So you can create an account and then you can start learning so this whole websites around You know giving resources about mentally healthy workplaces We're not going to cover that right now Don't have enough time So in this case, I've got logged in as a user. I've got one collection. Everyone also gets a default save resources collection So I'm going to go over to this collection. I've got two resources here if I go to this resource Do to do of course I get a giant error and why wouldn't I We've got this nice save button here So when we click that we get a modal and this is these are all react apps by the way If I quickly look over here, this is one of the cooler things that I wanted to demo Please God work So this motor itself is a react app and we want to say we want to save this piece of content To a new collection. So we're going to create a new collection. We're going to give it a name nice and meaningful and Then I've got the network tab open because I wanted to demo something which is Why I think GraphQL is so extremely powerful and yes, you could do this with other things but GraphQL makes it very easy So I'm going to create that collection and You notice. Hey, I've got the collection already in that modal, but I've only actually done one request and The reason we can do that is because GraphQL allows us to return Really nicely structured data. So we've got all the data we need for this collection Directly in the response from our mutation. We can just take that let it that object and put it into our query case We don't need a refetch that uses collections because we know this new collection is just going to be in the user's Users collections Therefore we can just add it to our query case. That's going to cause react to re-render and then it's just like we created this new collection Sorry that we It's just like we fetched that, you know new collection from the list. So finally of final bit of the demo I'm going to say I don't want that in that collection anymore. I wanted a my new one Save that that's going to do fire off multiple mutations which can be executed in series So you can do more than one mutation at a time You might have seen those little alerts pop up that say we've added or removed things from our collection Again displaying the correct status And Then if I go back to my my hub page, it's got that new collection here and Then we've got the save resource And This is the toggle share functionality as well Let's toggle it on copy the link go into a new That was the wrong new tab a new container That one no, I'm not logged in anymore. You can just trust me that works. I guess For some reason it's not playing pressing into cool. I think we've run out of time anyway, so that was about it Cool any questions a graph you are Yeah, I think we're like I guess a lot of the automation stuff like building all that schema is It is very hard to wrap your head around. That's probably the hardest thing, you know all the data producers and that's what I really wanted to hopefully ease anyone into if they're if they've kind of looked at that stuff and thought crap that looks confusing as hell and yeah, just Show you how powerful that stuff can be like it's very very worthwhile Yeah, I think what some of that kind of stuff is in the GraphQL compose module They've got like automated schema generation and all that kind of stuff You're obviously not gonna have as fine grain control over any of it, but yeah, definitely have a look to brahm Yeah, I've just I've got yeah all of my stuff is fully tested So we just use functional tests and then just part like the great thing about that GraphQL I sort of query interface is you can write all that GraphQL Query and then you can just inspect the network tab right to see exactly what is actually being sent and then I use that to put Into my functional tests and then I just Do those same requests just make sure you know data is coming back or errors are coming back and that's what that sort of thing so And then all of the front-end components are reacts and all that stuff We obviously we can use like mock service worker, which is a way to mock all of your responses and React or jest so and then we use that for the testing the actual front-end components I definitely wouldn't diss this stuff and like JTB or something like that So a 10-set query or it used to be called react query, but now it's used for it can be used for Anything I think there's like view and angular and stuff like that So that that example. Yeah, I didn't want to get into the react code because obviously there was shitload of stuff Sorry, it's a lot of stuff to get through But react query is like a way of As a library to query for stuff and it comes with a lot of like query caching Stale cache optimizations retries all that sort of thing for free and it's really easy to use So yeah, one of the best libraries out there for the front-end tooling