- Deploy docker-compose up --build -d(if you want daemon)
- run tests after deploy docker-compose run web pytest forum/tests.py
API: link with graphiql : http://0.0.0.0:8080/graphiql link without graphiql : http://0.0.0.0:8080/graphql
Queries:
- Section 1)Create Section:
mutation{ createSection(theme:"section_theme", description:"sectiondescription"){ ok } }
2)Change Section:
mutation{ changeSection(id_:1, theme:"updated_section_theme", description:"sectiondescription"){ ok } }
3)Delete Section:
mutation{ deleteSection(id_:1){ ok } }
- Section Pagination
{ sectionPagination(page:1,number:1) { totalPages sections { id } } }
with search by theme:
{ sectionPagination(page:1,number:1, search: "new") { totalPages sections { id } } }
- Get certain Section by id: { getSection(id_:1){ id theme description } }
- Post
- Create Post:
mutation{ createPost(sectionId:1 ,theme:"post_theme", description:"post_description"){ ok } }
2)Change Post:
mutation{ changePost(id_:1 ,theme:"post_theme"){ ok } }
3)Delete Post:
mutation{ deletePost(id_:1){ ok } }
- Post Pagination
{ postPagination(page:1,number:2, sectionId:1) { totalPages posts { id theme } } }
with search by theme:
{ postPagination(page:1,number:2, sectionId:1, search:"th") { totalPages posts { id theme } } }
- Get certain Post by id: { getPost(id_:1){ theme id description comments } }
- Comment
-
Create Comment: mutation{ createComment(postId:1, text:"ss"){ ok } }
-
Answer to Comment: mutation{ createComment(postId:1, text:"ss", parentId:1){ ok } }
-
Delete Comment: mutation{ deleteComment(id_:1){ ok } }