📎 Webclip
A Full-Stack Web App Using Blazor WebAssembly and GraphQL: Part 3
This part extends the movie app with edit and delete operations, plus sorting and filtering on the server and client. It also adds a movie details page, reusable rating, card, and genre components, a home page with sorting and genre filtering, and an admin panel for managing movies.
Reading notes#
IMoviegainsGetAllMovies,UpdateMovie, andDeleteMoviemethods.MovieDataAccessLayerimplementsGetAllMovieswithAsNoTracking, updates an existing movie byMovieId, and returns the poster path when deleting.MovieQueryResolveraddsGetMovieListwith[UseSorting]and[UseFiltering].EditMoviechecks whetherPosterPathis a base64 string, saves a new poster file when needed, and then updates the movie.DeleteMovieremoves the movie and deletes its poster file unless it is the default poster.Program.csregisters GraphQL filtering and sorting.- The client adds GraphQL queries and mutations for fetching, filtering, sorting, editing, and deleting movies.
- The app is configured to use Bootstrap and Font Awesome, and later adds Syncfusion Toast support.
MovieRatingis a reusable component that displays the rating with custom styling.MovieDetailsloads a movie byMovieID, shows the poster, title, overview, language, genre, rating, and formats duration as hours and minutes.MovieCardshows poster, title, genre, and rating, and links to the details page.MovieGenreloads genres and navigates to/category/{genreName}for filtering.Homesupports/and/category/{GenreName}, loads sorted movies by default, filters by genre, and sorts by title, rating, or duration.AddEditMovieloads movie data whenMovieIDis set and uses edit or add mutations depending on whether the movie already exists.ManageMovieslists movies in an admin table, opens a delete confirmation modal, and shows a toast after deletion.- The navigation bar is updated to link to the admin panel instead of the add movie link.
- The article ends by noting that the next part will cover authentication, authorization, login, registration, and client-side state management.
