【文件属性】:
文件名称:nexus-plugin-shield:在您的nexus应用程序中使用graphql-shield
文件大小:103KB
文件格式:ZIP
更新时间:2021-05-02 09:06:11
TypeScript
连结插件屏蔽
在您的应用程式中
安装
npm install nexus-plugin-shield
已知限制
不支持片段
用法示例
设置
// app.ts
import { use } from 'nexus'
import { shield , rule , deny , not , and , or } from 'nexus-plugin-shield'
const isAuthenticated = rule ( { cache : 'contextual' } ) (
async ( parent , args , ctx : NexusContext , info ) => {
return ctx . user !== null
}
)
const isAdmin = rule ( { cache : 'contextual' } ) (
async
【文件预览】:
nexus-plugin-shield-master
----.github()
--------workflows()
----yarn.lock(239KB)
----src()
--------settings.ts(604B)
--------index.ts(438B)
--------runtime.ts(295B)
--------schema.ts(3KB)
----tsconfig.json(405B)
----LICENSE(1KB)
----README.md(2KB)
----.gitignore(108B)
----package.json(1KB)