Releases: neo4j/graphql
@neo4j/graphql@2.5.3
@neo4j/graphql-ogm@2.5.3
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
@neo4j/graphql@2.5.2
@neo4j/graphql-ogm@2.5.2
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
@neo4j/graphql@2.5.1
🐛 Fixes
- Fix: Removes escaped labels from filter IN labels statements
- PR: #637
@neo4j/graphql-ogm@2.5.1
Updates the @neo4j/graphql
dependency, and introduces the changes listed below (if any).
@neo4j/introspector@1.0.0 🎉
Introducing @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/
API
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.
Sample usage
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()
Generated example
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)
}
@neo4j/graphql@2.5.0
🚀 Features
- Feat/fulltext
- PR: #563
- Sorting by relationship properties for union and interface fields
- PR: #598
- Feat/Aggregate Sum
- PR: #597
- Feature/connectOrCreate
- PR: #575
🐛 Fixes
- Fixed edge updates on one to one relationships
- PR: #579
- fix/559: add subscription type fields to resolve tree field resolver
- PR: #576
- Querying DateTime in the edge of a connection throws an error
- PR: #587
- Generate scalar typedefs before extra definitions
- PR: #599
- Fix/564: Async error when reading from JWKS endpoint
- PR: #578
- Fix for missing auth parameter
- PR: #603
- Fix: Project All Interface Fields For Types Implementing
@relationship
Interface- PR: #590
- Fix: Escape all
@node
directive labels- PR: #617
@neo4j/graphql-ogm@2.5.0
@neo4j/graphql@2.4.0
🚀 Features
- Feature: Support
Order By
for Primitive@cypher
Fields- PR: #501
- Inject context in additional labels
- PR: #536
- Interface relationship fields
- PR: #525
- Field-level aggregations
- PR: #521
- Feature/unique directive
- PR: #547
- Added OpenID Json Web Key Sets for verification via the @auth directive
- PR: #564
🐛 Fixes
- Fix: Project Interface Fields In Union Relationship
- PR: #509
- Solution for operations being duplicated following multiple deletes
- PR: #537
- Fix fieldAggregation types
- PR: #539
- Test the right thing in multi-database integration tests
- PR: #548
- Fix issue 488 handle union where on connections
- PR: #540
- Bugfix/dbms version check
- PR: #550
- Fix: call new on GraphQLString
- PR: #566
- Fix/null points
- PR: #565
- fix: error when only selecting info on update and create operations
- PR: #568