【发布时间】:2022-01-02 03:13:05
【问题描述】:
我正在尝试做这样的事情:
const neoSchema = new Neo4jGraphQL({
typeDefs,
driver,
resolvers,
config: {
jwt: {
secret: process.env.JWT_SECRET || 'secret',
},
database: process.env.NEO4J_DATABASE || 'neo4j',
auth: {
isAuthenticated: true,
hasRole: true,
},
},
})
但是当我在我的 graphql.schema 中这样做时:
type Avatar @isAuthenticated {
avatarId: ID! @id
name: String! @unique
picture: String!
coinPrice: Int!
collections: [AvatarCollection]
@relationship(type: "AVATAR_COLLECTION_AVATAR", direction: IN)
}
我收到此错误:
unknown directive "@isAuthenticated".
我应该如何添加指令?
【问题讨论】:
标签: javascript node.js neo4j graphql grandstack