Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-20-2022 02:54 PM
Hi,
I can't get this to work for some reason:
type BlogPost
id: ID! @id
title: String
slug: @callback(operations: [CREATE, UPDATE], name: "slug")
const slugCallback = async (root: any) => {
// console.log("Slug callback", root);
return "something...";
};
const neoSchema = new Neo4jGraphQL({
typeDefs,
driver,
config: { callbacks: { slug: slugCallback } },
});
I receive the following error:
{
"name": "TypeError",
"message": "Failed to fetch",
"stack": "TypeError: Failed to fetch\n at
...etc
}
Seems like there's something wrong with the syntax. If I remove the @callback directive, then everything works as expected.
05-23-2022 08:04 PM
Hello, I think you may be fooled by the docment.
Yes,there is an error in docs.
slug: @callback(operations: [CREATE, UPDATE], name: "slug") should modified to
slug: String @callback(operations: [CREATE, UPDATE], name: "slug")
the above added String or some other type.
If you use ogm.init(). don't forget to pass config option to it too.
All the sessions of the conference are now available online