graphql

A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations.

APACHE-2.0 License

Downloads
80K
Stars
503
Committers
61

Bot releases are visible (Hide)

graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

🐛 Fixes

  • Fix: Removes escaped labels from filter IN labels statements
    • PR: #637
graphql - @neo4j/[email protected] 🎉

Published by github-actions[bot] almost 3 years ago

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)
}
graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

🚀 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
graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

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

🚀 Features

  • Feat/fulltext
    • PR: #563
  • Feat: Autogenerated Typescript for OGM
    • PR: #528
  • Feat/Aggregate Sum
    • PR: #597
  • Feature/connectOrCreate
    • PR: #575
graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] almost 3 years ago

🚀 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
graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

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

🚀 Features

  • Feat/top level aggregations
    • PR: #470
  • Refactor: dateTimeFields to temporalFields
    • PR: #466
graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

🚀 Features

  • Specify mapping of GraphQL type -> Neo4j node label using @node directive
    • PR: #475
  • Custom pluralization
    • PR: #492
  • Feat/where aggregations
    • PR: #519
  • Feat/top level aggregations
    • PR: #470
  • Refactor: dateTimeFields to temporalFields
    • PR: #466

🐛 Fixes

  • Fix missing subscription payload
    • PR: #503
  • Fix: Creation of Empty {Create,Update}Input for Relationship Properties
    • PR: #497
  • Fix: Filter Null Values In Union Relationship
    • PR: #494
  • fix: wrap auth sub clauses in parentheses to preserve precedence
    • PR: #506
  • Fix transformation of arguments to @cypher directives
    • PR: #527
  • Top level string aggregations length
    • PR: #529
  • Fix: Alias count top level
    • PR: #530
  • Add remaining node input types into validation
    • PR: #532
graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

🚀 Features

  • @alias directive - map a GraphQL field to a Neo4j node/relationship property under a different name
    • PR: #463
  • Feature: Add Duration Scalar
    • PR: #459

🐛 Fixes

  • Fix: Project Interface Fields
    • PR: #477
graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

🚀 Features

  • Add @relationshipProperties directive
    • PR: #455
  • Feature: Add Time Scalar
    • PR: #449
  • Feature: Add LocalTime Scalar
    • PR: #451
  • Feature: Add LocalDateTime Scalar
    • PR: #460
  • Return bookmarks so that users can read their own writes
    • PR: #458

🐛 Fixes

  • Fix variable assignment for filtering on relationship node in connections
    • PR: #438
  • Fix aliasing of ID, Int, and Float fields
    • PR: #439
  • Allow MutationResponse and SortDirection through validation
    • PR: #445
  • Fix/433 - Exclude empty where from cypher generation
    • PR: #453
  • Fix @id and @timestamp for relationship properties
    • PR: #457
  • Wrap disconnect operations in subqueries
    • PR: #441
graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

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

graphql - @neo4j/[email protected]

Published by github-actions[bot] about 3 years ago

🐛 Fixes

  • Resolve node/relationship variable naming collision
    • PR: #419
  • Fix/413: Count query not working with allow @auth
    • PR: #415
  • Fix/402: Error when using an optional variable with _IN on a related node
    • PR: #416
  • Fix union connections with where clause
    • PR: #418
  • Aliased fields from custom Cypher
    • PR: #423
  • Fix incorrect replacement of projection parameters in translateCreate
    • PR: #428
  • Fixed issue #425 (broken count)
    • PR: #426
graphql - Neo4j GraphQL Library 2.0.0

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.

Features

Improvements

Fixes and refactors

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.

Resources

graphql - OGM 2.0.0

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.

graphql - Neo4j GraphQL Library 2.0.0-rc.2

Published by darrellwarde about 3 years ago

Changes

Fixes

  • An error is now thrown if @auth, @cypher or @relationship directives are used on an relationship property interface or its fields (#379, #381, #383)
  • Generated input types being used within custom input types will now pass validation of type definitions (#373)
  • Custom scalars/enums now work as return values for custom Cypher fields (#390)
  • Error thrown if reserved words used in type definitions (#396):
    • 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 fields

Notes

We 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.

graphql - OGM 2.0.0-rc.2

Published by darrellwarde about 3 years ago

Updated the @neo4j/graphql dependency.

Package Rankings
Top 1.65% on Npmjs.org
Related Projects