Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.17 KB

readme.adoc

File metadata and controls

52 lines (42 loc) · 1.17 KB

JVM Library to translate GraphQL queries and mutations to Neo4j’s Cypher

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}"

Features

  • 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)

Next

  • @relationship types

  • filters

  • sorting (nested)

  • interfaces

  • input types

  • @cypher for fields

  • auto-generate queries

  • auto-generate mutations

  • unions