Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.23 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.23 KB

Open in CodeSandbox

Recommendations GraphQL API

This directory contains a Node.js GraphQL API application using @neo4j/graphql.

Try it live on CodeSandbox here

Setup

First, edit .env, replacing the defaults with your database connection string, user, and database (optional):

NEO4J_URI=
NEO4J_USER=
NEO4J_PASSWORD=
NEO4J_DATABASE=

The NEO4J_DATABASE environment variable is optional and can be omitted. When omitted the default database will be used.

Next, install dependencies.

npm install

Then start the API application,

npm run start

This will start a local GraphQL API server at localhost:4000.

Example GraphQL Queries

{
  movies(where: { year_GT: 2014 }, options: { limit: 10 }) {
    title
    genres {
      name
    }
    similar(first: 5) {
      title
    }
    actors {
      name
    }
  }
}