Closed harryjin closed 1 year ago
Many thanks for raising this bug report @harryjin. :bug: We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! :pray:
Many thanks for raising this bug report @harryjin. :bug: We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! :pray:
I tried to reproduce your issue with the latest version of the library 3.17.1, with the reproduction step that you have provided without any success. Could you share more details on how to reproduce it? I can share the reproduction step I've used:
async function run() {
const driver = neo4j.driver("bolt://localhost:7687", neo4j.auth.basic("user", "password"));
const typeDefs = gql`
type URL @auth(rules: [{ isAuthenticated: true }]) {
_id: ID!
address: String!
status_code: Int
canonical: String
title_1: String
titleLen: Int
h1_1: String
h1_1Len: Int
fullText: String
fullHTMLText: String
links: [URL!]! @relationship(type: "LINKS_TO", direction: OUT)
outlinks: Int
inlinks: Int
}
`;
const neoSchema = new Neo4jGraphQL({
typeDefs,
driver,
plugins: {
auth: new Neo4jGraphQLAuthJWTPlugin({
secret: "secret",
noVerify: false,
}),
},
});
const schema = await neoSchema.getSchema();
}
run()
I tried to reproduce your issue with the latest version of the library 3.17.1, with the reproduction step that you have provided without any success. Could you share more details on how to reproduce it? I can share the reproduction step I've used:
async function run() { const driver = neo4j.driver("bolt://localhost:7687", neo4j.auth.basic("user", "password")); const typeDefs = gql` type URL @auth(rules: [{ isAuthenticated: true }]) { _id: ID! address: String! status_code: Int canonical: String title_1: String titleLen: Int h1_1: String h1_1Len: Int fullText: String fullHTMLText: String links: [URL!]! @relationship(type: "LINKS_TO", direction: OUT) outlinks: Int inlinks: Int } `; const neoSchema = new Neo4jGraphQL({ typeDefs, driver, plugins: { auth: new Neo4jGraphQLAuthJWTPlugin({ secret: "secret", noVerify: false, }), }, }); const schema = await neoSchema.getSchema(); } run()
Thanks for your help. Please use follow schema. https://drive.google.com/file/d/1uxj6l1cXxCZhEWzIbWx_Ty2rHZQ28CjX/view?usp=share_link
I haven't even reproduced, but given there are 3 errors, I'm 99% sure the problem fields are:
Mutation.initiateNewCrawl
Mutation.startCrawl
Query.myProfile
You cannot use our @auth
directive on a field resolved by a custom resolver. The @auth
directive is assessed in Cypher, and with a custom resolver there is no Cypher.
Closing this one due to inactivity, and this is not a known problem. I suggest using something like GraphQL Shield if you want authentication on fields resolved by custom resolvers.
Describe the bug During migrating from neo4j-graphql-js to @neo4j/graphql, it don't recognize @auth directive.
Type definitions Type definitions
To Reproduce
const schema = await neoSchema.getSchema()
Screenshots
System (please complete the following information):
Additional context Add any other context about the problem here.