There are two ways of validating your graphql input types, via Directives or manually validating the input type in your resolver. In this episode we focus on the more old-school approach and put the JSR-303 bean validation annotations on our pojos. In a following tutorial, we will look at graphql-java-extended-validation which will allow us to remove all java bean validation annotations, and instead place the annotations directly on the schema. Pretty cool.
As graphql-java-extended-validation is still under active development and first stable release was 2 days ago (17 September 2020) I will provide tutorials on both validation methods .
There are always multiple ways of solving problems and normally neither are wrong. So its good to list all options. In the end, we pick what we find the most beneficial and efficient :)
In the next video we look at graphql-java-extended-validation and how we can validation with graphql schema directives instead of java annotations. That way we keep our pojos clean.
Thanks!
Philip
Spring Boot GraphQL: https://github.com/graphql-java-kicks...
Java GraphQL Extended Validation: https://github.com/graphql-java/graph...
Auf dieser Seite können Sie das Online-Video Spring Boot GraphQL Tutorial #18 - Input Validation (Method 1 - Bean) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Philip Starritt 19 September 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 8,293 Mal angesehen und es wurde von 53 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!