This is an early stage alpha implementation written in Kotlin.
The basic usage should be:
val schema =
"""
type Person {
name: String
age: Int
}
type Query {
person : [Person]
personByName(name:String) : Person
}"""
val query = """ { p:personByName(name:"Joe") { age } } """
val schema = SchemaBuilder.buildSchema(idl)
val (cypher, params) = Translator(schema).translate(query, params)
cypher == "MATCH (p:Person) WHERE p.name = 'Joe' RETURN p {.age}"
-
parse SDL schema
-
resolve query fields via result types
-
handle arguments as equality comparisons for top level and nested fields
-
handle relationships via @relation directive on schema fields
-
handle first, offset arguments
-
argument types: string, int, float, array
-
parameter support
-
parametrization
-
aliases
-
inline and named fragments
-
sorting (top-level)