A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.
APACHE-2.0 License
Bot releases are visible (Hide)
Published by github-actions[bot] almost 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] almost 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] almost 3 years ago
Published by github-actions[bot] almost 3 years ago
@neo4j/introspector
The purpose for this tool is to generate a starting point for putting a GraphQL schema in front of Neo4j and to save developers time.
This is via introspecting the Neo4j data shape and generating GraphQL Type Definitions from it.
After generating the typedefs developers probably want to continue to work on it manually to add @auth
etc and maybe remove fields to only expose what's intended.
The docs: https://neo4j.com/docs/graphql-manual/current/introspector/
At this point we expose the feature only through a programatic node API. We do aim to expose this through a CLI in the future, but no promises 🤞
There's also a readonly
flag to have all types being annotated with a @exclude(operations: [CREATE, DELETE, UPDATE])
directive.
From the docs example:
const { toGraphQLTypeDefs } = require("@neo4j/introspector")
const neo4j = require("neo4j-driver");
const fs = require('fs');
const driver = neo4j.driver(
"neo4j://localhost:7687",
neo4j.auth.basic("neo4j", "password")
);
const sessionFactory = () => driver.session({ defaultAccessMode: neo4j.session.READ, database: "neo4j" })
// We create a async function here until "top level await" has landed
// so we can use async/await
async function main() {
const typeDefs = await toGraphQLTypeDefs(sessionFactory)
fs.writeFileSync('schema.graphql', typeDefs)
await driver.close();
}
main()
A database with this data:
CREATE (m:Movie {title: "Title"})
CREATE (a:Actor {name: "Actor Name"})
CREATE (a2:Actor {name: "Actor 2 Name"})
MERGE (a)-[:ACTED_IN {roles: ["Role 1", "Role 2"], pay: toFloat(200), amb: "string"}]->(m)
MERGE (a2)-[:ACTED_IN {roles: ["Palm tree"], amb: toInteger(3)}]->(m)
MERGE (a)-[:DIRECTED {skill: toInteger(4)}]->(m)
MERGE (a)<-[:WON_PRIZE_FOR]-(m)
would generate these GraphQL typedefs:
interface ActedInProperties @relationshipProperties {
pay: Float
roles: [String]!
}
type Actor {
actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedInProperties")
directedMovies: [Movie!]! @relationship(type: "DIRECTED", direction: OUT, properties: "DirectedProperties")
moviesWonPrizeFor: [Movie!]! @relationship(type: "WON_PRIZE_FOR", direction: IN)
name: String!
}
interface DirectedProperties @relationshipProperties {
skill: BigInt!
}
type Movie {
actorsActedIn: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedInProperties")
actorsDirected: [Actor!]! @relationship(type: "DIRECTED", direction: IN, properties: "DirectedProperties")
title: String!
wonPrizeForActors: [Actor!]! @relationship(type: "WON_PRIZE_FOR", direction: OUT)
}
Published by github-actions[bot] almost 3 years ago
@relationship
Interface
@node
directive labels
Published by github-actions[bot] almost 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] almost 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] almost 3 years ago
Order By
for Primitive @cypher
Fields
Published by github-actions[bot] about 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] about 3 years ago
@node
directive
{Create,Update}Input
for Relationship Properties
@cypher
directives
Published by github-actions[bot] about 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] about 3 years ago
@alias
directive - map a GraphQL field to a Neo4j node/relationship property under a different name
Published by github-actions[bot] about 3 years ago
Published by github-actions[bot] about 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] about 3 years ago
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
Published by github-actions[bot] about 3 years ago
Published by darrellwarde about 3 years ago
Today's release is a big one, notably adding in support for relationship properties and cursor-based pagination! 🎉 Thank you all for your support of the library so far, we're really excited for today's release and hope that you enjoy it too. As per usual, please raise an issue for any problems which you encounter (of which we hope there will be very few!).
There are breaking changes between version 1.x and this 2.0.0 release. Please see the migration guide for the steps involved to migrate.
A whole lot of work has gone into this 2.0.0 release, which would make for some unwieldy release notes if listed here! If you want to see everything which has been released today, this pull request filter will show all of the work which was merged into the 2.0.0 branch.
Published by darrellwarde about 3 years ago
Updates the @neo4j/graphql
dependency to the new major 2.0.0 release.
Breaking changes for queries and mutations will be identical to the changes which break for the GraphQL Library, so the same migration guide can be followed.
Published by darrellwarde about 3 years ago
relationship
renamed to edge
in nested Mutations - see https://neo4j.com/docs/graphql-manual/2.0/type-definitions/relationships/#_inserting_data for examples (#389)checkNeo4jCompat
(#378)Neo4jGraphQLAuthenticationError
and Neo4jGraphQLForbiddenError
are now exported (#394)@auth
, @cypher
or @relationship
directives are used on an relationship property interface or its fields (#379, #381, #383)Node
and PageInfo
cannot be used as type/interfaces names, nor can names ending in Connection
cursor
and node
cannot be used as relationship property fieldsWe apologise for making the breaking change from edge
to relationship
during this release candidate phase, but we felt that the consistency improvement across the schema was worth the tradeoff.
Published by darrellwarde about 3 years ago
Updated the @neo4j/graphql
dependency.