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
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,8 @@ To run this blog system, you need the following software and tools installed on
35
35
36
36
## Configuration
37
37
38
-
- Customization: The application is highly customizable. You can modify views, styles, and GraphQL schema to suit your needs.
39
-
- Environment Variables: The .env file contains various environment variables to control the behavior of the application. Make sure to configure them correctly.
38
+
- Customization: The application is highly customizable. You can modify views, styles, and **GraphQL** schema to suit your needs.
39
+
- Environment Variables: The `.env` file contains various environment variables to control the behavior of the application. Make sure to configure them correctly.
40
40
41
41
## Usage
42
42
@@ -45,13 +45,15 @@ To run the blog system, use the following command:
45
45
```
46
46
php artisan serve
47
47
```
48
+
48
49
Now open `http://localhost:8000/graphiql`. this is a environment for running graphql queries and get response. in below window you can add Authorization token(you can get that after login or register) and dont forget to add `Content-Type: application/json` header.
49
50
50
51
## GraphQL
51
52
52
53
**Queries:**
53
54
54
55
- Get all blog posts: Retrieve a list of all blog posts with their titles and dates.
56
+
55
57
```graphql
56
58
query {
57
59
posts {
@@ -83,7 +85,9 @@ query {
83
85
}
84
86
}
85
87
```
88
+
86
89
- Get a single blog post: Retrieve detailed information about a specific blog post by its ID.
90
+
87
91
```graphql
88
92
query {
89
93
post(id: 2) {
@@ -100,6 +104,7 @@ query {
100
104
}
101
105
}
102
106
```
107
+
103
108
```json
104
109
{
105
110
"data": {
@@ -118,7 +123,9 @@ query {
118
123
}
119
124
}
120
125
```
126
+
121
127
- Search blog posts: Search for blog posts based on keywords and retrieve a list of matching posts.
128
+
122
129
```graphql
123
130
query {
124
131
search(key: "pizza") {
@@ -151,7 +158,9 @@ query {
151
158
}
152
159
}
153
160
```
161
+
154
162
- Get all categories: Retrieve a list of all blog categories.
163
+
155
164
```graphql
156
165
query {
157
166
categories {
@@ -164,6 +173,7 @@ query {
164
173
}
165
174
}
166
175
```
176
+
167
177
```json
168
178
{
169
179
"data": {
@@ -180,7 +190,9 @@ query {
180
190
}
181
191
}
182
192
```
193
+
183
194
- Get all tags: Retrieve a list of all blog tags.
195
+
184
196
```graphql
185
197
query {
186
198
tags {
@@ -193,14 +205,17 @@ query {
193
205
}
194
206
}
195
207
```
208
+
196
209
```json
197
210
{
198
211
"data": {
199
212
"tags": []
200
213
}
201
214
}
202
215
```
216
+
203
217
- Get popular posts: Retrieve a list of the most popular blog posts based on views or comments.
218
+
204
219
```graphql
205
220
query {
206
221
popularPosts {
@@ -219,6 +234,7 @@ query {
219
234
}
220
235
}
221
236
```
237
+
222
238
```json
223
239
{
224
240
"data": {
@@ -241,6 +257,7 @@ query {
241
257
}
242
258
}
243
259
```
260
+
244
261
- Get user profile: Retrieve information about the currently logged-in user.
245
262
- Get user's own posts: Retrieve a list of blog posts created by the currently logged-in user.
246
263
- Get user's favorite posts: Retrieve a list of blog posts marked as favorites by the currently logged-in user.
0 commit comments