You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+173Lines changed: 173 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,10 +50,183 @@ php artisan serve
50
50
51
51
The application will be accessible at `http://localhost:8000` by default. You can access the GraphQL playground at `http://localhost:8000/graphql-playground` to interact with the API.
52
52
53
+
## GraphQL
54
+
55
+
**Queries:**
56
+
57
+
- Get all blog posts: Retrieve a list of all blog posts with their titles and dates.
58
+
- Get a single blog post: Retrieve detailed information about a specific blog post by its ID.
59
+
- Search blog posts: Search for blog posts based on keywords and retrieve a list of matching posts.
60
+
- Get all categories: Retrieve a list of all blog categories.
61
+
- Get all tags: Retrieve a list of all blog tags.
62
+
- Get recent posts: Retrieve a list of the most recent blog posts.
63
+
- Get popular posts: Retrieve a list of the most popular blog posts based on views or comments.
64
+
- Get comments for a post: Retrieve all comments associated with a specific blog post.
65
+
- Get user profile: Retrieve information about the currently logged-in user.
66
+
- Get user's own posts: Retrieve a list of blog posts created by the currently logged-in user.
67
+
- Get user's favorite posts: Retrieve a list of blog posts marked as favorites by the currently logged-in user.
68
+
- Get recommended posts: Retrieve a list of recommended blog posts based on user preferences or behavior.
69
+
- Get posts by category: Retrieve all blog posts belonging to a specific category.
70
+
- Get posts by tag: Retrieve all blog posts associated with a specific tag.
71
+
- Get total number of posts: Retrieve the total number of blog posts in the system.Get posts by author: Retrieve all blog posts written by a specific author.
72
+
- Get user by ID: Retrieve detailed information about a user by their ID.
73
+
- Get trending tags: Retrieve a list of the most popular tags used in blog posts.
74
+
- Get related posts: Retrieve a list of related blog posts based on the current post's tags or category.
75
+
- Get post comments count: Retrieve the total number of comments for a specific blog post.
76
+
- Get user activity: Retrieve a user's recent activity, including posts created, comments made, and liked posts.
77
+
- Get most active users: Retrieve a list of the most active users based on the number of posts and comments they've made.
78
+
- Get user notifications: Retrieve a list of notifications for the currently logged-in user.
79
+
- Get posts by date range: Retrieve blog posts published within a specified date range.
80
+
- Get posts by popularity: Retrieve blog posts sorted by popularity (e.g., based on likes, views, or comments).
81
+
- Get posts by user's location: Retrieve blog posts based on the user's geolocation or specified location filter.
82
+
- Get posts with specific metadata: Retrieve blog posts based on custom metadata or attributes associated with them.
83
+
- Get user activity by date: Retrieve a user's activity within a specified date range, including posts and comments.
84
+
- Get posts with attachments: Retrieve blog posts that have attachments such as images, videos, or files.
85
+
- Get posts by popularity in a time range: Retrieve blog posts sorted by popularity within a specific time period (e.g., the last month).
86
+
- Get posts by tag popularity: Retrieve tags ordered by their popularity based on the number of times they have been used.
87
+
- Get posts with similar titles: Retrieve blog posts with titles similar to a given query.
88
+
- Get posts based on language: Retrieve blog posts written in a specific language or language code.
89
+
90
+
**Mutations:**
91
+
92
+
- Create a new blog post: Create a new blog post with title, content, category, and tags.
93
+
- Update a blog post: Update an existing blog post by its ID with new title, content, category, or tags.
94
+
- Delete a blog post: Delete a specific blog post by its ID.
95
+
- Create a new comment: Add a new comment to a blog post with the author's name and comment content.
96
+
- Update a comment: Update an existing comment by its ID with new content.
97
+
- Delete a comment: Delete a specific comment by its ID.
98
+
- Like a post: Allow a user to like a blog post, incrementing its likes count.
99
+
- Dislike a post: Allow a user to remove their like from a blog post, decrementing its likes count.
100
+
- Add post to favorites: Allow a user to add a blog post to their list of favorite posts.
101
+
- Remove post from favorites: Allow a user to remove a blog post from their list of favorite posts.
102
+
- Register new user: Create a new user account with username, email, and password.
103
+
- Login: Authenticate a user and issue an access token upon successful login.
104
+
- Logout: Invalidate the user's access token upon logout.
105
+
- Update user profile: Update the currently logged-in user's profile information.
106
+
- Change password: Allow the user to change their account password.
107
+
- Create a new category: Allow an admin user to create a new blog post category.
108
+
- Update a category: Allow an admin user to update the name or description of a category.
109
+
- Delete a category: Allow an admin user to delete a category, along with its associated blog posts.
110
+
- Create a new tag: Allow an admin user to create a new blog post tag.
111
+
- Update a tag: Allow an admin user to update the name or description of a tag.
112
+
- Delete a tag: Allow an admin user to delete a tag, removing it from all associated blog posts.
113
+
- Flag inappropriate content: Allow users to flag a blog post or comment as inappropriate for review by administrators.
114
+
- Approve flagged content: Allow administrators to review flagged content and mark it as approved or disapproved.
115
+
- Create a new user role: Allow an admin user to create a new role with specific permissions.
116
+
- Update user role: Allow an admin user to update the permissions of an existing role.
117
+
- Add post view: Increment the view count of a blog post when a user visits it.
118
+
- Create a new user account with social login: Allow users to register using their social media accounts (e.g., Google or Facebook).
119
+
- Reset user password: Allow users to request a password reset email if they forget their password.
120
+
- Confirm email address: Enable users to confirm their email address after registration.
121
+
- Delete user account: Allow users to delete their own accounts and associated data.
122
+
- Share post: Allow users to share blog posts via email or social media.
123
+
- Pin post: Allow an admin user to pin a blog post to the top of the homepage or a specific category.
124
+
- Unpin post: Allow an admin user to remove a pinned status from a blog post.
125
+
- Moderate comments: Allow moderators to review and approve or reject comments before they appear on the site.
126
+
53
127
## GraphQL Schema
54
128
55
129
The GraphQL schema defines the types, queries, mutations, and subscriptions available in the API. The schema can be found in the graphql directory.
We welcome contributions from the community. If you want to contribute to the project, please fork the repository, make your changes, and submit a pull request.
0 commit comments