This file contains hidden or 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
| git checkout <oldname> | |
| git branch -m <newname> | |
| git push origin -u <newname> | |
| git push origin --delete <oldname> |
This file contains hidden or 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
| export const ADD_CLIENT = gql` | |
| mutation addClient($name: String!, | |
| $email: String!, | |
| $phone: String!, | |
| ) { | |
| addClient(name: $name, email: $email, phone: $phone) { | |
| id | |
| name | |
| phone |
This file contains hidden or 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
| import {gql} from '@apollo/client'; | |
| export const DELETE_CLIENT = gql` | |
| mutation deleteClient($id: ID!) { | |
| deleteClient(id: $id) { | |
| id | |
| name | |
| phone | |
| } |
This file contains hidden or 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
| import {gql} from '@apollo/client'; | |
| export const GET_CLIENTS = gql` | |
| query getClients { | |
| clients { | |
| id | |
| name | |
| phone | |
| } |
This file contains hidden or 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
| import { useState } from "react"; | |
| import {FaUser} from 'react-icons/fa'; | |
| import {useMutation} from '@apollo/client' | |
| import { ADD_CLIENT } from "../mutations/clientMutations"; | |
| import { GET_CLIENTS } from "../queries/clientQueries"; | |
| export default function AddClientModal() { | |
| const [name,setName] = useState(''); | |
| const [email,setEmail] = useState(''); | |
| const [phone,setPhone] = useState(''); |
This file contains hidden or 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
| import Header from "./components/Header"; | |
| import Clients from "./components/Clients"; | |
| import {ApolloProvider, ApolloClient, InMemoryCache} from '@apollo/client' | |
| const cache = new InMemoryCache({ | |
| typePolicies:{ | |
| Query: { | |
| fields: { | |
| clients: { | |
| merge(existing,incoming) { |
This file contains hidden or 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
Show hidden characters
| { | |
| "presets": ["@babel/preset-env","@babel/preset-react"] | |
| } |
This file contains hidden or 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
| const express = require('express'); | |
| const colors = require('colors'); | |
| const cors = require('cors'); | |
| require('dotenv').config(); | |
| const {graphqlHTTP} = require('express-graphql'); | |
| const schema = require('./schema/schema'); | |
| const port = process.env.PORT ||5000; | |
| const app = express(); |
This file contains hidden or 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
| const Project = require('../models/Project'); | |
| const Client = require('../models/Client'); | |
| const { | |
| GraphQLObjectType, | |
| GraphQLID, | |
| GraphQLString, | |
| GraphQLSchema, | |
| GraphQLList, | |
| GraphQLNonNull, |
This file contains hidden or 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
| const mongoose = require('mongoose'); | |
| const ProjectSchema = new mongoose.Schema({ | |
| name: { type:String,}, | |
| description : { type: String,}, | |
| clientId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'Client', | |
| }, | |
| status: { |