cancel
Showing results for 
Search instead for 
Did you mean: 

Graphql schema direction value through API

We are trying to create GraphQL API to connect neo4j Database
in which we are trying to connect other schema Type in base node schema type as below

CUSTOMER_REL: [Customer_Base] @relation(name: "CUSTOMER_PHONE", direction: IN)

Is there any way i can retrieve value of direction (it can either IN or OUT) from Graphql API

2 REPLIES 2

William_Lyon
Graph Fellow

GraphQL schema directives (where this information is encoded in the GraphQL schema) are not currently exposed via GraphQL introspection (see this issue) so I don't see a way to retrieve this information via the GraphQL API - you'd need to have access to the SDL to inspect the directive argument values.

Alternatively, you could access this information by querying Neo4j using the apoc.meta.schema() procedure.

Thanks for clarification. running apoc.meta.schema Cypher take some time for execution. so its not a good idea to execute from UI side

I try to create new property in schema but i also need to pass Cypher query to connect it.

count: Int
@cypher(
statement: """
MATCH (n:Customer) RETURN count(*)
"""
)

is there any way i can create new property (direction) in Schema Type to pass static value IN or OUT (means it not need to go to neo4j database to fetch value , it can take from Schema )

direction: String
IN

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.