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
+140-4Lines changed: 140 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,17 +312,153 @@ query {
312
312
}
313
313
```
314
314
- Get user's favorite posts: Retrieve a list of blog posts marked as favorites by the currently logged-in user.
315
-
- Get recommended posts: Retrieve a list of recommended blog posts based on user preferences or behavior.
315
+
```graphql
316
+
query {
317
+
myFavorites {
318
+
post {
319
+
title
320
+
}
321
+
}
322
+
}
323
+
```
324
+
```json
325
+
{
326
+
"data": {
327
+
"myFavorites": []
328
+
}
329
+
}
330
+
```
316
331
- Get posts by category: Retrieve all blog posts belonging to a specific category.
332
+
```graphql
333
+
query {
334
+
category(id: 1) {
335
+
posts {
336
+
title
337
+
content
338
+
likes
339
+
views
340
+
isPublished
341
+
}
342
+
}
343
+
}
344
+
```
345
+
```json
346
+
{
347
+
"data": {
348
+
"category": {
349
+
"posts": [
350
+
{
351
+
"title": "pizza",
352
+
"content": "here we want to learn how make a pizza.",
353
+
"likes": 34,
354
+
"views": 2974,
355
+
"isPublished": true
356
+
},
357
+
{
358
+
"title": "moon and mars",
359
+
"content": "i want to be first person walked throught mars",
360
+
"likes": 0,
361
+
"views": 0,
362
+
"isPublished": true
363
+
}
364
+
]
365
+
}
366
+
}
367
+
}
368
+
```
317
369
- Get posts by tag: Retrieve all blog posts associated with a specific tag.
370
+
```graphql
371
+
query {
372
+
tag(id: 1) {
373
+
name
374
+
description
375
+
posts {
376
+
id
377
+
title
378
+
content
379
+
category {
380
+
name
381
+
}
382
+
likes
383
+
views
384
+
}
385
+
}
386
+
}
387
+
```
388
+
```json
389
+
{
390
+
"data": {
391
+
"tag": null
392
+
}
393
+
}
394
+
```
318
395
- 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.
396
+
```graphql
397
+
query {
398
+
countOfPosts
399
+
}
400
+
```
401
+
```json
402
+
{
403
+
"data": {
404
+
"countOfPosts": 2
405
+
}
406
+
}
407
+
```
319
408
- Get user by ID: Retrieve detailed information about a user by their ID.
320
-
- Get trending tags: Retrieve a list of the most popular tags used in blog posts.
321
-
- Get related posts: Retrieve a list of related blog posts based on the current post's tags or category.
322
-
- Get post comments count: Retrieve the total number of comments for a specific blog post.
409
+
```graphql
410
+
query {
411
+
user(id: 2) {
412
+
name
413
+
username
414
+
email
415
+
email_verified_at
416
+
}
417
+
}
418
+
```
419
+
```json
420
+
{
421
+
"data": {
422
+
"user": {
423
+
"name": "Ali",
424
+
"username": "AliAhmadi",
425
+
"email": "aliahmadi82c@gmail.com",
426
+
"email_verified_at": null
427
+
}
428
+
}
429
+
}
430
+
```
323
431
- Get user activity: Retrieve a user's recent activity, including posts created, comments made, and liked posts.
324
432
- Get most active users: Retrieve a list of the most active users based on the number of posts and comments they've made.
325
433
- Get user notifications: Retrieve a list of notifications for the currently logged-in user.
434
+
```graphql
435
+
query {
436
+
user(id: 2) {
437
+
name
438
+
username
439
+
email
440
+
email_verified_at
441
+
notifications {
442
+
id
443
+
message
444
+
created_at
445
+
}
446
+
}
447
+
}
448
+
```
449
+
```json
450
+
{
451
+
"data": {
452
+
"user": {
453
+
"name": "Ali",
454
+
"username": "AliAhmadi",
455
+
"email": "aliahmadi82c@gmail.com",
456
+
"email_verified_at": null,
457
+
"notifications": []
458
+
}
459
+
}
460
+
}
461
+
```
326
462
- Get posts by date range: Retrieve blog posts published within a specified date range.
327
463
- Get posts by popularity: Retrieve blog posts sorted by popularity (e.g., based on likes, views, or comments).
328
464
- Get posts by user's location: Retrieve blog posts based on the user's geolocation or specified location filter.
0 commit comments