-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fec54f
commit 66682c7
Showing
13 changed files
with
288 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
### Queries | ||
|
||
- Get Article By Slug | ||
``` | ||
query GetPostBySlug($slug: String){ | ||
articleByLink(link: $slug){ | ||
id | ||
title | ||
thumbnail | ||
} | ||
} | ||
``` | ||
|
||
- Get all articles | ||
``` | ||
query GetAllArticle{ | ||
allArticles{ | ||
id | ||
title | ||
content | ||
thumbnail | ||
link | ||
createdAt | ||
author{ | ||
id | ||
name | ||
} | ||
category{ | ||
id | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Mutations | ||
- Create category | ||
``` | ||
mutation CreateCategory{ | ||
createOrUpdateCategory(name: "Category - 10" ){ | ||
category{ | ||
id | ||
name | ||
} | ||
} | ||
} | ||
``` | ||
|
||
- Create an article with curl | ||
``` | ||
curl --location 'http://localhost:8000/graphql/' \ | ||
--form 'operations="{ | ||
\"query\": \"mutation ($title: String!, $content: String!, $thumbnail: Upload!, $authorId: ID!, $categoryId: ID!, $id: ID) { createOrUpdateArticle(title: $title, content: $content, thumbnail: $thumbnail, authorId: $authorId, categoryId: $categoryId, id: $id) { article { id title content thumbnail author { id name } category { id name } } } }\", | ||
\"variables\": { | ||
\"title\": \"Test Article - 10\", | ||
\"content\": \"This is a test article\", | ||
\"thumbnail\": null, | ||
\"authorId\": \"1\", | ||
\"categoryId\": \"1\" | ||
} | ||
}"' \ | ||
--form 'map="{ | ||
\"0\": [\"variables.thumbnail\"] | ||
}"' \ | ||
--form '0=@"/home/shayon/Pictures/pexels-daniel-reis-19575513.jpg"' | ||
``` | ||
|
||
- Create a comment | ||
``` | ||
mutation CreateComment{ | ||
createOrUpdateComment(author: "Md SHayon", email:"[email protected]", text: "This is comment 1", articleId: 8){ | ||
comment{ | ||
id | ||
article{ | ||
id | ||
title | ||
link | ||
} | ||
author | ||
text | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,4 @@ | ||
# Nuxt 3 Minimal Starter | ||
# Nuxt js blog | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install | ||
|
||
# yarn | ||
yarn install | ||
|
||
# bun | ||
bun install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000`: | ||
|
||
```bash | ||
# npm | ||
npm run dev | ||
|
||
# pnpm | ||
pnpm run dev | ||
|
||
# yarn | ||
yarn dev | ||
|
||
# bun | ||
bun run dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
# npm | ||
npm run build | ||
|
||
# pnpm | ||
pnpm run build | ||
|
||
# yarn | ||
yarn build | ||
|
||
# bun | ||
bun run build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
# npm | ||
npm run preview | ||
|
||
# pnpm | ||
pnpm run preview | ||
|
||
# yarn | ||
yarn preview | ||
|
||
# bun | ||
bun run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. | ||
- Add article with thumbnail image | ||
- Display article content properly according to quill editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.