Skip to content

Conversation

@hatfelicien
Copy link
Contributor

@hatfelicien hatfelicien commented Nov 5, 2024

PR Description

Create a community page where users can ask and answer questions using Apollo Server.

Description of tasks that were expected to be completed

  • All internet users who can access the DevPulse site are able to view asked questions and their answers.
  • Only authenticated DevPulse users are allowed to ask questions and answer previously asked questions.

Steps to Test

To test this feature, follow these steps:

  1. Clone the repository:

    git clone https://github.com/atlp-rwanda/atlp-pulse-bn.git
  2. Navigate to the feature branch:

    cd atlp-pulse-bn
    git checkout ft-community-page
  3. Set up and run the backend server:

    • Ensure your Apollo Server is running by executing the appropriate start command for your Node.js backend.
    npm install
    npm start
  4. Test GraphQL Operations:

    • Open the Apollo Server playground at http://localhost:<PORT>/graphql to interact with the GraphQL API.
    • Use the following queries and mutations to test the functionality:

    Example Queries:

    • Fetch all questions:

      query {
        questions {
          id
          title
          content
          author {
            firstName
            lastName
          }
          answers {
            content
          }
        }
      }
    • Fetch a single question by ID:

      query {
        question(id: "questionID") {
          id
          title
          content
          author {
            firstName
            lastName
          }
          answers {
            content
            author {
              firstName
              lastName
            }
          }
        }
      }

    Example Mutations:

    • Create a question (DevPulse users only):

      mutation {
        createQuestion(title: "How to deploy Apollo Server?", content: "I'm stuck at deployment.") {
          id
          title
          content
        }
      }
    • Create an answer (DevPulse users only):

      mutation {
        createAnswer(questionId: "questionID", content: "Here is how you can deploy...") {
          id
          content
          author {
            firstName
            lastName
          }
        }
      }

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code generates no warnings.
  • My test coverage meets the set test coverage threshold.
  • There are no vulnerabilities.
  • There are no conflicts with the base branch.

@codecov-commenter

This comment was marked as resolved.

Copy link
Contributor

@elijahladdie elijahladdie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elijahladdie elijahladdie added Needs Reviews A pull request need reviews to be merged ready for review steppers Steppers Team labels Nov 14, 2024
* Added missing secret in env

* test: deployment

* feat: run the action on push

---------

Co-authored-by: ceelogre <[email protected]>
@ceelogre ceelogre temporarily deployed to ft-community-page - devpulse-backend PR #412 November 15, 2024 09:42 — with Render Destroyed
@Salim-54 Salim-54 merged commit a871830 into develop Nov 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Reviews A pull request need reviews to be merged ready for review steppers Steppers Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants