Coder Social home page Coder Social logo

user-service-graphql's Introduction

Environment Variables

PORT=4000 - #required
NODE_ENV=development #required
DEBUG=user-service:* 
DATABASE_URL=postgres://app:[email protected]:5432/postgres #required
LOG_LOCATION=C:\ #required
LOG_NAME=testlogs.log 
JWT_SECRET=devSecret #required
GRAPHIQL=true

Docker Commands

To Create Docker volume

docker volume create pgdata

To Run development DB

docker run
-d
-e POSTGRES_PASSWORD=test
-e POSTGRES_USER=app
-e PGDATA=/var/lib/postgresql/data/pgdata
-p 127.0.0.1:5432:5432
--mount source=pgdata,target=/var/lib/postgresql/data/pgdata
postgres

down vote accepted To run pg_dump you can use docker exec command:

To backup:

docker exec -u <your_postgres_user> <postgres_container_name> pg_dump -Fc <database_name_here> > db.dump

To drop db (Don't do it on production, for test purpose only!!!):

docker exec -u <your_postgres_user> <postgres_container_name> psql -c 'DROP DATABASE <your_db_name>'

To restore:

docker exec -i -u <your_postgres_user> <postgres_container_name> pg_restore -C -d postgres < db.dump

Also you can use docker-compose analog of exec. In that case you can use short services name (postgres) instead of full container name (composeproject_postgres).

Graphql

Mutations

mutation {
  updateUser(userId: "e8bac95b-fcc8-4ebd-8261-a28de2eff1ed", input:{
    FirstName:"Jordan"
    LastName:"Addison"
    PhoneNumber:"2285470060"
  }) {
    id,
    Email
    FirstName
  }
}
mutation {
  createUser(input:{
    FirstName:"Jordan"
    LastName:"Addison"
    PhoneNumber:"2285470060"
    Email: "[email protected]"
    Password: "$tudenT1"
    ConfirmPassword: "$tudenT1"
  }) {
    id,
    Email
    FirstName
  }
}

user-service-graphql's People

Contributors

jjordy avatar

Watchers

James Cloos avatar  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.