Since the React 16.8 update which added hooks to function components, you might have seen function components replacing class components everywhere.
Function components are far less verbose, and require less boilerplate. They’re a bit more flexible with hooks and custom hooks, and they are usually a bit more performant.
Note: in the examples below, I’ve shown how to import `React` and `Component`. Note that if you’re using React 17 and above, it may no longer be necessary to explicitly import react in your code, depending on your JSX transform. …
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
Let’s start with the initial configuration, first of all, we need to create our new project with the Nest CLI
The purpose of this article will be to show how to handle and validate the data for a rest endpoint with NestJS framework.
Suppose that we want to create an endpoint to add a product, and we want to validate that the product name is not empty, and is the required field. What is the way to do that with NestJS?