Coder Social home page Coder Social logo

challenge-graphql's Introduction

Challenge Graphql Project

Docker - Installation for Docker

Setup

This project is setup to be a fully contained project. Meaning that other than Docker, Node, and NPM, you shouldn't need anything else installed to run this project locally.

  • Open a tab in your comsole and run docker-compose up
  • In another tab run knex migrate:latest
  • Next run npm install
  • Finally run npm run dev

Notes & Tips

  • This project usees an ORM called Knex to interface the the database: Knex
  • This project uses JWT's and to complete one of the requirments of this project you will need to send a user token in the headers of your request.
  • If you do not have a tool for exploring the Graphql api I suggest that you use Graphql Playground
  • The models folder is where the you will find helper method using knex to query the database.
  • The resolvers folder is where all of the Graphql and Queries should live.
  • The shared folder primarily contains third party integrations.
  • resolvers/root-types.js is where all queries and mutation need to be defined.
  • resolvers/index.js is where you will inport your queries and mutations for a new resolver.

Connecting to the Database.

  • Personally I use Postico, but use whatever tool you want.
  • Username: postgres
  • Password: postgres
  • Database: challenge_db
  • Port: 5433

The Challenge

You need to create a new set resolver called projects. Specifically you need to:

  1. Create a mutation for creating a new project

  • Only logged in users should be able to create a project.
  • The name of the project should be "required" in the graphql schema.
  • The current user should be set as the user_id or owner for that project.
  1. Create a query to fetch all projects for a user

  • Should only return that user's projects
  • The Project type that you create should have a user field that allows you to fetch the User type.

challenge-graphql's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.