0.3.0 • Published 5 years ago

point-api-service v0.3.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 years ago

Point Api Service

GraphQL API Service for Point Medici Backend

Setup

  • Install the dependencies npm install
  • Install nodemon to watch and auto-reload your program on code changesnpm i -g nodemon
  • Install standardJS code style linter/formatter : npm i --global standard snazzy

Git Hooks

  • Lint code automatically before each commit : cp ./git-hooks/pre-commit .git/hooks/

Using ESLint/Prettier in Atom Editor

You’ll need to install the Atom packages linter, linter-eslint, linter-ui-default, and prettier-atom in order for the integration to work. After you install dev dependencies, prettier and eslint should automatically get to work linting your code.

Testing / Debugging

Photo Upload

You can either test the photo upload by creating a react app or via the following curl command :

curl http://localhost:4000/graphql \
  -F operations='{"query": "mutation ($file: Upload!, $type: DocumentType!) { uploadPhotoID(file: $file, type: $type) }", "variables": { "file": null, "type": "PHOTO_ID_FRONT" } }' \
  -F map='{ "0": ["variables.file"] }' \
  -F 0=@<photo_filepath> \
  -H "Authorization: Bearer <access_token>"

Note : DocumentType possible values, PHOTO_ID_FRONT or PHOTO_ID_BACK