anyway to pass dynamic complete cypher query as input variable in graphql
like below .my cypher query changes dynamically so looking for some dynamic approach while defining graphql schema.
Yes, any field arguments defined in a Cypher directive GraphQL field are passed as Cypher parameters to the Cypher query defined in the directive. For example:
type Query {
movieSearch(searchTerm: String!): [Movie] @cypher(statement: """
MATCH (m:Movie) WHERE m.title CONTAINS $searchTerm
RETURN m
"""
}
As an aside, if you are looking to calculate the total number of nodes matching some filter you may benefit from the auto-generated count queries: Queries - Neo4j GraphQL Library