use yew::prelude::*; #[derive(Properties, PartialEq)] pub struct GraphQLErrorsProps { pub errors: Option>, } pub struct GraphQLErrors; impl Component for GraphQLErrors { type Message = (); type Properties = GraphQLErrorsProps; fn create(_ctx: &Context) -> Self { Self } fn view(&self, ctx: &Context) -> Html { html! { if let Some(errors) = &ctx.props().errors {

{ "Errors:" }

{ for errors.iter().map(|e| html! {

{ e }

}) }
} } } } pub fn convert(errors: Option>) -> Option> { errors.map(|x| x.iter().map(|e| e.message.to_owned()).collect()) }