neo4j-graphql-cli

Deploy a Neo4j backed GraphQL API based on your GraphQL schema

Showing:

Popularity

Downloads/wk

3

GitHub Stars

62

Maintenance

Last Commit

2yrs ago

Contributors

3

Package

Dependencies

4

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Node.js GraphQL

Readme

Neo4j GraphQL CLI

NOTE: This project is deprecated in favor of neo4j-graphql.js

Deploy Neo4j backed GraphQL APIs based on your custom GraphQL schema.

This is a very early project, under active development. Use for prototyping and demo projects only

What does it do?

neo4j-graphql-cli allows you to deploy a Neo4j GraphQL instance on Neo4j Sandbox. This Neo4j GraphQL instance will serve a GraphQL endpoint based on a user-defined GraphQL schema.

Steps

  1. npm install -g neo4j-graphql-cli
  2. Define your GraphQL schema using GraphQL schema syntax, myschema.graphql
  3. neo4j-graphql myschema.graphql - if you do not specify a schema a default movies schema will be used.
  4. When prompted sign into Neo4j Sandbox using the URL provided. This URL will include a token to associate your neo4j-graphql-cli session with your sandbox instance.
  5. Once your Neo4j GraphQL instance is deployed, you'll be presented with the credentials for your GraphQL instance, including a Graphiql URL.

Schema First Development

IDL / Schema Syntax

Neo4j GraphQL Schema

Neo4j GraphQL supports the basic schema syntax, with the addition of directives that expose the power of a graph database when combined with GraphQL:

  • @cypher

@cypher directive

The @cypher directive exposes the power of a full graph query language, Cypher, through GraphQL.

Example movies schema

type User {
  id: Int
  name: String!
  movies: [Movie] @relation(name: "RATED", direction: "out")
}

type Movie {
  id: Int
  title: String!
  year: Int
  plot: String
  poster: String
  imdbRating: Float
  genres: [Genre] @relation(name: "IN_GENRE", direction: "out")
  actors: [Actor] @relation(name: "ACTED_IN", direction: "in")
  directors: [Director] @relation(name: "DIRECTED", direction: "in")
  similar: [Movie] @cypher(statement: "WITH {this} AS this MATCH (this)-[:IN_GENRE]->(:Genre)<-[:IN_GENRE]-(rec:Movie) WITH rec, COUNT(*) AS num ORDER BY num DESC RETURN rec LIMIT 10")
}

type Genre {
  id: Int
  name: String!
  movies: [Movie] @relation(name: "IN_GENRE", direction: "in")
}

type Director {
  id: Int
  name: String!
  movies: [Movie] @relation(name: "DIRECTED", direction: "out")
}

type Actor {
  id: Int
  name: String!
  movies: [Movie] @relation(name: "ACTED_IN", direction: "out")
}

.graphqlconfig

neo4j-graphql-cli supports .graphqlconfig and will create a .graphqlconfig file that contains the path to the schema file, endpoints and authorization header. For example:

{
  "schemaPath":"personSchema.graphql",
  "extensions":
    {
      "endpoints":
      {
        "dev":
          {
            "url": "10-0-1-70-34285.neo4jsandbox.com/graphql/",
            "headers":
            {
              "Authorization":"Basic ${env:NEO4J_GRAPHQL_TOKEN}"
            }
          }
      }
    }
}

Features

  • deploy Neo4j GraphQL Sandbox instance
  • support user defined GraphQL schema
  • support @cypher GraphQL schema directives
  • .graphqlconfig support
  • support self-hosted Neo4j instances. NOTE: see
  • Docker support
  • support schema updates
  • client app scaffolding

Feedback

This project is in active development and user validation. Have a use case you'd like to see supported? We'd love to hear your feedback, please email devrel@neo4j.com

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

apollo-boost:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
User Rating
4.6/ 5
5
Top Feedback
4Great Documentation
4Easy to Use
3Performant
GitHub Stars
17K
Weekly Downloads
247K
graphql-tagA JavaScript template literal tag that parses GraphQL queries
User Rating
3.8/ 5
4
Top Feedback
3Great Documentation
3Easy to Use
2Performant
GitHub Stars
2K
Weekly Downloads
4M
eg
elasticsearch-graphqlSchema generator and query builder for elasticsearch
User RatingN/A
Top Feedback
N/A
GitHub Stars
166
Weekly Downloads
2
postgraphileExecute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database!
User Rating
4.8/ 5
6
Top Feedback
3Highly Customizable
2Easy to Use
2Performant
GitHub Stars
11K
Weekly Downloads
4K
auc
apollo-upload-clientA terminating Apollo Link for Apollo Client that fetches a GraphQL multipart request if the GraphQL variables contain files (by default FileList, File, Blob, or ReactNativeFile instances), or else fetches a regular GraphQL POST or GET request (depending on the config and GraphQL operation).
User Rating
4.8/ 5
4
Top Feedback
3Easy to Use
1Great Documentation
1Bleeding Edge
GitHub Stars
1K
Weekly Downloads
780K
See 21 Alternatives

Tutorials

No tutorials found
Add a tutorial