Closed Chimba123 closed 4 years ago
Are you using the database plugin or this middleware library?
Can you share your script / screenshot?
What does "doesn't work" mean?
@jexp locally I am using the plugin installed automatically from the plugin section then for my sandbox I am using a graphene database with the Full APOC installed.
In both cases, the command is not working when I use the "@cypher" directive
the code is as follows
graphql.idl(“ type User { followsCount:Int @cypher ( statement: "MATCH (this)<-[r:FOLLOWS_ON_SOCIALS]-(:User) with this, count(r) as rel_cnt return rel_cnt" ) } “)
I am getting the following error: Neo.ClientError.Statement.SyntaxError Invalid input 'M': expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, ',' or ')' (line 20, column 13 (offset: 574)) "statement: "MATCH (this)<-[r:FOLLOWS_ON_SOCIALS]-(:User) with this, count(r) as rel_cnt return rel_cnt"
@jexp not working means it's not setting the schema when the "@cypher" directive is in the command and frankly it's disturbing
I have realized all the examples where the @cypher directive is used is that you guys have not used with CALL graphql.idl()
command as a wrapper to the schemas... perhaps there is a special way of doing it in graphql that you guys are not showing?
take for example the link given above it just shows the schema... but not the procedure command to create the schema with graphql
@jexp ITS NOT WORKING AND THE INSTRUCTIONS WRT GRAPHQL JAVA and the CALL graphql.idl()
command are not clearly shown, only raw schema objects are shown but not with the command ... something is off ... I mean I have tried a lot of schemas in the procedure with the "@cypher" directive, I have downgraded even but the graphql plugin on the Neo4j desktop isn't generating graphql schemas when there is an "@cypher" directive.. maybe you try it on Neo4j desktop with the CALL graphql.idl()
and see for yourself
You saw that you were using double quotes within double quotes? You should use single quotes on the procedure call string.
Also this is the wrong repo, the correct repo for the plugin is github.com/neo4j-graphql/neo4j-graphql
graphql.idl(' type User { followsCount:Int @cypher ( statement: "MATCH (this)<-[r:FOLLOWS_ON_SOCIALS]-(:User) with this, count(r) as rel_cnt return rel_cnt" ) } ')
You saw that you were using double quotes within double quotes? You should use single quotes on the procedure call string.
Also this is the wrong repo, the correct repo for the plugin is github.com/neo4j-graphql/neo4j-graphql
graphql.idl(' type User { followsCount:Int @cypher ( statement: "MATCH (this)<-[r:FOLLOWS_ON_SOCIALS]-(:User) with this, count(r) as rel_cnt return rel_cnt" ) } ')
Thanks a lot !!! wow what a simple solution!!
I am using Neo4j 3.5.14 with the APOC plugin installed everything else works fine
However, when I try to update the graphql schema with cypher queries using the @cypher directive using
CALL graphql.idl()
it just doesn't work. I have used the example schema here https://neo4j.com/developer/graphql/ it still doesn't work.