{"id":13516789,"url":"https://github.com/neo4j-graphql/neo4j-graphql-js","last_synced_at":"2025-09-30T10:30:51.504Z","repository":{"id":50131016,"uuid":"105578084","full_name":"neo4j-graphql/neo4j-graphql-js","owner":"neo4j-graphql","description":"NOTE: This project is no longer actively maintained. Please consider using the official Neo4j GraphQL Library (linked in README).","archived":true,"fork":false,"pushed_at":"2022-09-07T08:38:51.000Z","size":5206,"stargazers_count":610,"open_issues_count":230,"forks_count":154,"subscribers_count":30,"default_branch":"dev","last_synced_at":"2024-04-27T18:32:47.024Z","etag":null,"topics":["cypher","graphql","neo4j","neo4j-graphql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j-graphql.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-02T19:51:20.000Z","updated_at":"2024-04-17T04:20:03.000Z","dependencies_parsed_at":"2022-08-26T23:42:00.566Z","dependency_job_id":null,"html_url":"https://github.com/neo4j-graphql/neo4j-graphql-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fneo4j-graphql-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fneo4j-graphql-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fneo4j-graphql-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fneo4j-graphql-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-graphql","download_url":"https://codeload.github.com/neo4j-graphql/neo4j-graphql-js/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234724892,"owners_count":18877279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypher","graphql","neo4j","neo4j-graphql"],"created_at":"2024-08-01T05:01:25.875Z","updated_at":"2025-09-30T10:30:46.120Z","avatar_url":"https://github.com/neo4j-graphql.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"\u003e ⚠️ NOTE: This project is no longer actively maintained. Please consider using the [official Neo4j GraphQL Library.](https://neo4j.com/docs/graphql-manual/current/)\n\n[![CI status](https://circleci.com/gh/neo4j-graphql/neo4j-graphql-js.svg?style=shield\u0026circle-token=d01ffa752fbeb43585631c78370f7dd40528fbd3)](https://circleci.com/gh/neo4j-graphql/neo4j-graphql-js) [![npm version](https://badge.fury.io/js/neo4j-graphql-js.svg)](https://badge.fury.io/js/neo4j-graphql-js) [![Docs link](https://img.shields.io/badge/Docs-GRANDstack.io-brightgreen.svg)](https://github.com/neo4j-graphql/neo4j-graphql-js/tree/master/docs)\n\n# neo4j-graphql.js\n\nA GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.\n\n- [Read the docs](https://github.com/neo4j-graphql/neo4j-graphql-js/tree/master/docs)\n- [Read the changelog](https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/CHANGELOG.md)\n\nneo4j-graphql.js is facilitated by [Neo4j Labs](https://neo4j.com/labs/).\n\n## Installation and usage\n\nInstall\n\n```\nnpm install --save neo4j-graphql-js\n```\n\n### Usage\n\nStart with GraphQL type definitions:\n\n```javascript\nconst typeDefs = `\ntype Movie {\n    title: String\n    year: Int\n    imdbRating: Float\n    genres: [Genre] @relation(name: \"IN_GENRE\", direction: \"OUT\")\n}\ntype Genre {\n    name: String\n    movies: [Movie] @relation(name: \"IN_GENRE\", direction: \"IN\")\n}\n`;\n```\n\nCreate an executable schema with auto-generated resolvers for Query and Mutation types, ordering, pagination, and support for computed fields defined using the `@cypher` GraphQL schema directive:\n\n```javascript\nimport { makeAugmentedSchema } from 'neo4j-graphql-js';\n\nconst schema = makeAugmentedSchema({ typeDefs });\n```\n\nCreate a neo4j-javascript-driver instance:\n\n```javascript\nimport { v1 as neo4j } from 'neo4j-driver';\n\nconst driver = neo4j.driver(\n  'bolt://localhost:7687',\n  neo4j.auth.basic('neo4j', 'letmein')\n);\n```\n\nUse your favorite JavaScript GraphQL server implementation to serve your GraphQL schema, injecting the Neo4j driver instance into the context so your data can be resolved in Neo4j:\n\n```javascript\nimport { ApolloServer } from 'apollo-server';\n\nconst server = new ApolloServer({ schema, context: { driver } });\n\nserver.listen(3003, '0.0.0.0').then(({ url }) =\u003e {\n  console.log(`GraphQL API ready at ${url}`);\n});\n```\n\nIf you don't want auto-generated resolvers, you can also call `neo4jgraphql()` in your GraphQL resolver. Your GraphQL query will be translated to Cypher and the query passed to Neo4j.\n\n```js\nimport { neo4jgraphql } from 'neo4j-graphql-js';\n\nconst resolvers = {\n  Query: {\n    Movie(object, params, ctx, resolveInfo) {\n      return neo4jgraphql(object, params, ctx, resolveInfo);\n    }\n  }\n};\n```\n\n## What is `neo4j-graphql.js`\n\nA package to make it easier to use GraphQL and [Neo4j](https://neo4j.com/) together. `neo4j-graphql.js` translates GraphQL queries to a single [Cypher](https://neo4j.com/developer/cypher/) query, eliminating the need to write queries in GraphQL resolvers and for batching queries. It also exposes the Cypher query language through GraphQL via the `@cypher` schema directive.\n\n### Goals\n\n- Translate GraphQL queries to Cypher to simplify the process of writing GraphQL resolvers\n- Allow for custom logic by overriding of any resolver function\n- Work with `graphql-tools`, `graphql-js`, and `apollo-server`\n- Support GraphQL servers that need to resolve data from multiple data services/databases\n- Expose the power of Cypher through GraphQL via the `@cypher` directive\n\n## Benefits\n\n- Send a single query to the database\n- No need to write queries for each resolver\n- Exposes the power of the Cypher query language through GraphQL\n\n## Contributing\n\nSee our [detailed contribution guidelines](./CONTRIBUTING.md).\n\n## Examples\n\nSee [/examples](https://github.com/neo4j-graphql/neo4j-graphql-js/tree/master/example/apollo-server)\n\n## [Documentation](docs/)\n\nFull docs can be found in [docs/](docs/)\n\n## Debugging and Tuning\n\nYou can log out the generated cypher statements with an environment variable:\n\n```\nDEBUG=neo4j-graphql-js node yourcode.js\n```\n\nThis helps to debug and optimize your database statements. E.g. visit your Neo4J\nbrowser console at http://localhost:7474/browser/ and paste the following:\n\n```\n:params :params { offset: 0, first: 12, filter: {}, cypherParams: { currentUserId: '42' } }\n```\n\nand now profile the generated query:\n\n```\nEXPLAIN MATCH (`post`:`Post`) WITH `post` ORDER BY post.createdAt DESC RETURN `post` { .id , .title } AS `post`\n```\n\nYou can learn more by typing:\n\n```\n:help EXPLAIN\n:help params\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-graphql%2Fneo4j-graphql-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-graphql%2Fneo4j-graphql-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-graphql%2Fneo4j-graphql-js/lists"}