Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-26-2020 02:43 AM
Hi all,
I'm facing an issue with neo4j-graphql-js npm module. I want to manipulate data inside GraphQL resolvers (like an OGM with models: findAll, findById, update, etc.) to add more business logic. But neo4j-graphql-js doesn't provide a way to do it, just maps GraphQL functions to one cypher query.
My typical use case is the following:
I have Article and Tag nodes. An Article can be tagged by multiple Tags. So, when I create an Article, I want to create the Article but Tags and relations too. I can do it with a single cypher but I think isn't the proper way when the app will growth.
To solve this issue, I found two ways:
What is the best way ? Or is there another way to solve it ?
Thanks !
11-26-2020 12:59 PM
Are you sure the @cypher
directives and custom resolvers outlined here don't provide the functionality you're after?
11-30-2020 03:28 AM
I think not, because @cypher
directives add more logic to types and functions, but in custom resolvers I can't access to these models and their functions. So, if I want to check if a resource A exists in the database before create a resource B, I haven't any tool to do it currently. The idea would be to expose auto-generated functions into the graphql context to use them inside resolvers (like an ORM/OGM).
12-07-2020 12:43 PM
Finally, my solution was to package neo4j-graphql as a microservice, requested by my business logic layer
All the sessions of the conference are now available online