Skip to content

Releases: neo4j/graphql

@neo4j/graphql@2.5.3

15 Dec 12:46
Compare
Choose a tag to compare

🐛 Fixes

  • Reverts #572 non nullable relation checks

@neo4j/graphql-ogm@2.5.3

15 Dec 12:46
Compare
Choose a tag to compare

Updates the @neo4j/graphql dependency, and introduces the changes listed below (if any).

@neo4j/graphql@2.5.2

14 Dec 13:16
Compare
Choose a tag to compare

🐛 Fixes

  • Fix context being overriden in for multiple queries #620

@neo4j/graphql-ogm@2.5.2

14 Dec 13:16
Compare
Choose a tag to compare

Updates the @neo4j/graphql dependency, and introduces the changes listed below (if any).

@neo4j/graphql@2.5.1

13 Dec 18:22
Compare
Choose a tag to compare

🐛 Fixes

  • Fix: Removes escaped labels from filter IN labels statements

@neo4j/graphql-ogm@2.5.1

13 Dec 18:22
Compare
Choose a tag to compare

Updates the @neo4j/graphql dependency, and introduces the changes listed below (if any).

@neo4j/introspector@1.0.0 🎉

01 Dec 15:33
Compare
Choose a tag to compare

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

01 Dec 13:39
Compare
Choose a tag to compare

🚀 Features

  • Feat/fulltext
  • Sorting by relationship properties for union and interface fields
  • Feat/Aggregate Sum
  • Feature/connectOrCreate

🐛 Fixes

  • Fixed edge updates on one to one relationships
  • fix/559: add subscription type fields to resolve tree field resolver
  • Querying DateTime in the edge of a connection throws an error
  • Generate scalar typedefs before extra definitions
  • Fix/564: Async error when reading from JWKS endpoint
  • Fix for missing auth parameter
  • Fix: Project All Interface Fields For Types Implementing @relationship Interface
  • Fix: Escape all @node directive labels

@neo4j/graphql-ogm@2.5.0

01 Dec 13:39
Compare
Choose a tag to compare

Updates the @neo4j/graphql dependency, and introduces the changes listed below (if any).

🚀 Features

  • Feat/fulltext
  • Feat: Autogenerated Typescript for OGM
  • Feat/Aggregate Sum
  • Feature/connectOrCreate

@neo4j/graphql@2.4.0

09 Nov 10:26
Compare
Choose a tag to compare

🚀 Features

  • Feature: Support Order By for Primitive @cypher Fields
  • Inject context in additional labels
  • Interface relationship fields
  • Field-level aggregations
  • Feature/unique directive
  • Added OpenID Json Web Key Sets for verification via the @auth directive

🐛 Fixes

  • Fix: Project Interface Fields In Union Relationship
  • Solution for operations being duplicated following multiple deletes
  • Fix fieldAggregation types
  • Test the right thing in multi-database integration tests
  • Fix issue 488 handle union where on connections
  • Bugfix/dbms version check
  • Fix: call new on GraphQLString
  • Fix/null points
  • fix: error when only selecting info on update and create operations