This is a GraphQL microservice implementation of deskbluez with the goal to decouple the application backend system for ui implementations.
-
Subscribe to desk state changes via graphQL subscriptions
-
Perform mutations: Up/Down
- See requirements section deskbluez#requirements
$ npm install -g deskgraph
Deskbluez is not required but its necessary to configure the devices
Deskgraph uses the same configuration manager as deskbluez
, every created profile is compatible with the deskgraph as long the micro-service and the cli tool is used by the same user.
$ deskgraph
Access graphQL endpoint under:
http://localhost:3000/graphql
When PLAYGROUND is enabled, the apollo-playground is accessible under
/graphql
HTTP_PORT=XXXX (default: 3000)
PLAYGROUND=X (default: 0)
USAGE:
$ PLAYGROUND=1 HTTP_PORT=5000 deskgraph
Playground:
import {NestFactory, AppModule} from "deskgraph";
async function customBootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
}
customBootstrap();
You can use the nestjs module separately by importing the DeskModule
:
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { DeskModule } from 'deskgraph';
@Module({
imports: [
GraphQLModule.forRoot({
autoSchemaFile: 'schema.gql',
installSubscriptionHandlers: true,
}),
DeskModule,
/**
* Your additional modules
*/
],
})
export class YourCustomNestJSModuleApplication {}
OR just use the DeskService
:
import { Module } from '@nestjs/common';
import { DeskbluezService } from 'deskgraph';
@Module({
providers: [DeskService],
})
export class MyNestJSModule {}
all you need is here, keep calm and stop being emotional, start using nestjs with typescript and don't waste your time.