Skip to content

Commit f806c5e

Browse files
authored
Update README.md
1 parent 5506221 commit f806c5e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ To run this blog system, you need the following software and tools installed on
3535

3636
## Configuration
3737

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.
4040

4141
## Usage
4242

@@ -45,13 +45,15 @@ To run the blog system, use the following command:
4545
```
4646
php artisan serve
4747
```
48+
4849
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.
4950

5051
## GraphQL
5152

5253
**Queries:**
5354

5455
- Get all blog posts: Retrieve a list of all blog posts with their titles and dates.
56+
5557
```graphql
5658
query {
5759
posts {
@@ -83,7 +85,9 @@ query {
8385
}
8486
}
8587
```
88+
8689
- Get a single blog post: Retrieve detailed information about a specific blog post by its ID.
90+
8791
```graphql
8892
query {
8993
post(id: 2) {
@@ -100,6 +104,7 @@ query {
100104
}
101105
}
102106
```
107+
103108
```json
104109
{
105110
"data": {
@@ -118,7 +123,9 @@ query {
118123
}
119124
}
120125
```
126+
121127
- Search blog posts: Search for blog posts based on keywords and retrieve a list of matching posts.
128+
122129
```graphql
123130
query {
124131
search(key: "pizza") {
@@ -151,7 +158,9 @@ query {
151158
}
152159
}
153160
```
161+
154162
- Get all categories: Retrieve a list of all blog categories.
163+
155164
```graphql
156165
query {
157166
categories {
@@ -164,6 +173,7 @@ query {
164173
}
165174
}
166175
```
176+
167177
```json
168178
{
169179
"data": {
@@ -180,7 +190,9 @@ query {
180190
}
181191
}
182192
```
193+
183194
- Get all tags: Retrieve a list of all blog tags.
195+
184196
```graphql
185197
query {
186198
tags {
@@ -193,14 +205,17 @@ query {
193205
}
194206
}
195207
```
208+
196209
```json
197210
{
198211
"data": {
199212
"tags": []
200213
}
201214
}
202215
```
216+
203217
- Get popular posts: Retrieve a list of the most popular blog posts based on views or comments.
218+
204219
```graphql
205220
query {
206221
popularPosts {
@@ -219,6 +234,7 @@ query {
219234
}
220235
}
221236
```
237+
222238
```json
223239
{
224240
"data": {
@@ -241,6 +257,7 @@ query {
241257
}
242258
}
243259
```
260+
244261
- Get user profile: Retrieve information about the currently logged-in user.
245262
- Get user's own posts: Retrieve a list of blog posts created by the currently logged-in user.
246263
- Get user's favorite posts: Retrieve a list of blog posts marked as favorites by the currently logged-in user.

0 commit comments

Comments
 (0)