feat: admin auth + config ref + modules sidebar ui + GQL upload (wip)
This commit is contained in:
@@ -7,6 +7,7 @@ const PubSub = require('graphql-subscriptions').PubSub
|
||||
const { LEVEL, MESSAGE } = require('triple-beam')
|
||||
const Transport = require('winston-transport')
|
||||
const { createRateLimitTypeDef } = require('graphql-rate-limit-directive')
|
||||
const { GraphQLUpload } = require('graphql-upload')
|
||||
|
||||
/* global WIKI */
|
||||
|
||||
@@ -26,7 +27,9 @@ schemas.forEach(schema => {
|
||||
|
||||
// Resolvers
|
||||
|
||||
let resolvers = {}
|
||||
let resolvers = {
|
||||
Upload: GraphQLUpload
|
||||
}
|
||||
const resolversObj = _.values(autoload(path.join(WIKI.SERVERPATH, 'graph/resolvers')))
|
||||
resolversObj.forEach(resolver => {
|
||||
_.merge(resolvers, resolver)
|
||||
|
45
server/graph/schemas/asset.graphql
Normal file
45
server/graph/schemas/asset.graphql
Normal file
@@ -0,0 +1,45 @@
|
||||
# ===============================================
|
||||
# ASSETS
|
||||
# ===============================================
|
||||
|
||||
extend type Query {
|
||||
assets: AssetQuery
|
||||
}
|
||||
|
||||
extend type Mutation {
|
||||
assets: AssetMutation
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
# QUERIES
|
||||
# -----------------------------------------------
|
||||
|
||||
type AssetQuery {
|
||||
list(
|
||||
root: String
|
||||
kind: [AssetKind]
|
||||
): [AssetItem]
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
# MUTATIONS
|
||||
# -----------------------------------------------
|
||||
|
||||
type AssetMutation {
|
||||
upload(
|
||||
data: Upload!
|
||||
): DefaultResponse
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
# TYPES
|
||||
# -----------------------------------------------
|
||||
|
||||
type AssetItem {
|
||||
id: Int!
|
||||
}
|
||||
|
||||
enum AssetKind {
|
||||
IMAGE
|
||||
BINARY
|
||||
}
|
@@ -58,6 +58,7 @@ type AuthenticationStrategy {
|
||||
props: [String]
|
||||
title: String!
|
||||
description: String
|
||||
isAvailable: Boolean
|
||||
useForm: Boolean!
|
||||
logo: String
|
||||
color: String
|
||||
|
Reference in New Issue
Block a user