0.0.1 • Published 5 years ago
images-microservice v0.0.1
Microservice - Images
Dependencies
Download and install ImageMagick
Install
First you need NodeJS v5+ and NPM v3+ installed, then just clone the repository and run npm install --production
for production and npm install
for development.
Usage
Types
type paginationResponse {
images: [image]
nextPage: pagination
}
type image {
id: String
filename: String
title: String
description: String
tags: [String]
sizes: sizes
updatedAt: Int
createdAt: Int
}
type pagination {
offset: Int
pageSize: Int
}
type sizes {
original: String
thumb: String
xs: String
sm: String
md: String
lg: String
}
Queries
images(query: String, offset: Int = 0, pageSize: Int = 20): paginationResponse
image(id: String): image
Mutations
delete(id: String!): image
create(title: String, description: String, tags: [String]): image
update(id: String!, title: String, description: String, tags: [String]): image
NOTE: Update and Create mutations require to be send as a multipart/form-data
with two fields:
image: the image file
query: the GraphQL mutation query
Production
For production use the common start command, like this:
npm start
0.0.1
5 years ago