feat: flash query endpoint

This commit is contained in:
Alexis Tyler
2021-04-14 21:52:06 +09:30
parent e2690cc18f
commit 409287260b
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/*!
* Copyright 2021 Lime Technology Inc. All rights reserved.
* Written by: Alexis Tyler
*/
import { varState } from '../../../core/states';
import { ensurePermission } from '../../../core/utils';
import { Context } from '../../schema/utils';
export default async (_: unknown, __: unknown, context: Context) => {
ensurePermission(context.user, {
resource: 'flash',
action: 'read',
possession: 'any'
});
return {
guid: varState.data.flashGuid,
vendor: varState.data.flashVendor,
product: varState.data.flashProduct
};
};

View File

@@ -0,0 +1,13 @@
type Query {
flash: Flash
}
type Subscription {
flash: Flash!
}
type Flash {
guid: String
vendor: String
product: String
}