3.0.6 • Published 7 years ago

graphql2cypher v3.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

graphql2cypher

Naive parser from graphql to cypher query.

js-standard-style build status Greenkeeper badge

main.js:

tape('user entity with address', (t) => {
  t.plan(2)
  parse(`
    user(id: <id>) {
      properties {
        name,
        address(edge: ":address", addressId: <addressId>) {
          properties {
            line
          }
        }
      }
    }
  `, (err, r) => {
    t.error(err)
    t.equals(r.cql, expected)
  })
  var expected = `
    match(user:user {id: {id}}) optional match(user)<-[:address]->(address:address {addressId: {addressId}})
    return *
  `
})

To see how reduce works to see how it looks check out fixtures, It works together with the module cypherquery

relationships, labels and graph

This requires that the statement sent to cypher has resultType ['row', 'graph']]

relationships

You can ask for relationships in graphql

`
    user(id: <id>) {
      relationships,
      ...
`

labels

You can ask for labels in graphql

`
    user(id: <id>) {
      labels
      ...
`

graph

You can ask for the raw graph as returned by cypher

`
    user(id: <id>) {
      graph
      ...
`

install

With npm do:

npm install graphql2cypher

test

npm test

license

MIT

3.0.6

7 years ago

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago