Skip to content

pinecone-studio/pinecone-advocate-graphql-challenge

Repository files navigation

🌲💼 Pinecone Advocate GraphQL Challenge 🚀

📋 Overview

Welcome to the Pinecone Advocate GraphQL Challenge! 🌟

In this challenge, you will:

  • 🛠️ Learn how to write GraphQL queries and mutations
  • 🧪 Test your code using Jest for unit tests

This guide will walk you through:

  • ⚙️ Setting up your project
  • 🖋️ Implementing GraphQL operations
  • 🏃‍♂️ Running commands to test your solution

Let's dive in and make learning GraphQL fun and exciting! 😎

⚙️ Setup Instructions

Here’s how to get started with the project:

  1. Install Dependencies:

    If you're using Yarn:

    yarn install
    

    Or, if you prefer npm:

    npm install
  2. Add your MongoDB Connection URL to .env File:

    MONGODB_URL=YOUR_MONGODB_URL
    1. Once you've added your MongoDB connection string, start the project. If the connection is successful, you’ll see connection successful in the console. If there’s an issue, it will show connection Failed.

🚀 Required Mutations and Queries to complete challenges

In this challenge, you'll need to implement the following GraphQL operations:

1. Mutations:

  • addTask:

    • This mutation creates a new todo task.

    • Required fields:

      • taskName (String) => required
      • description (String) => required ( must be at least 10 characters long )
      • isDone (Boolean) => default to false
      • priority (Int) => required (values 1-5)
      • tags (Array of Strings) => optional, allows categorization
      • createdAt (Date)
      • updatedAt (Date)
      • _id (MongoDB Object Id)
  • updateTask:

    • This mutation updates an existing task's details using its taskId.
    • Fields to update:
      • taskName (String)
      • description (String)
      • priority (Int) => validate within range 1-5
      • isDone (Boolean)
      • tags (Array of Strings) => append or remove tags

2. Queries:

  • getDoneTasksLists:

    • This query retrieves all tasks that have been marked as done.
  • searchTasks:

    • Accepts searchTerm (String): performs a case-insensitive match.
    • Supports advanced filtering options: - priority (Int) - isDone (Boolean) - createdBefore (Date) - createdAfter (Date)
  • getAllTasks:

⚙️ Command Instructions

Here’s how to run the project after implementing the GraphQL operations:

Start the Project:

To start the development server, run:

yarn dev
  1. Then open Apollo Studio Sandbox and add your local GraphQL endpoint (e.g., http://localhost:3000/api/graphql) to start testing your queries and mutations.

Run Tests:

To run your Jest tests and ensure everything works as expected, use:

yarn test

Good luck on the challenge! 🍀

Don't forget to read the PDF file for instructions on how to submit your challenge.

We hope you do great, and we look forward to seeing you in the final interview! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published