Skip to content

Releases: neo4j/graphql

@neo4j/graphql@7.0.0-alpha.7

07 Apr 15:36
5f7c1cc
Compare
Choose a tag to compare
Pre-release

Patch Changes

@neo4j/graphql@7.0.0-alpha.6

07 Apr 09:31
d425b1b
Compare
Choose a tag to compare
Pre-release

Major Changes

  • #6153 0779691 Thanks @angrykoala! - Fails schema validation if a field with @relationship targets a type without @node.

    For example, the following schema will fail:

    type Movie @node {
        someActors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT)
    }
    
    type Actor {
        name: String
    }
  • #6158 19dc0dd Thanks @angrykoala! - Remove option CONNECT_OR_CREATE from argument nestedOperations from @relationship directives as it is no longer relevant after connectOrCreate have been removed

  • #6109 6801d70 Thanks @darrellwarde! - The where field for nested update operations has been moved within the update input field.
    The where in its previous location was a no-op for all nested operations apart from update.

    For example, the following syntax would filter the Post nodes to update in Version 6:

    mutation {
        updateUsers(
            where: { name: { eq: "Darrell" } }
            update: {
                posts: {
                    where: { node: { title: { eq: "Version 7 Release Notes" } } }
                    update: { node: { title: { set: "Version 7 Release Announcement" } } }
                }
            }
        )
    }

    In Version 7, this where has been moved inside the update operation:

    mutation {
        updateUsers(
            where: { name: { eq: "Darrell" } }
            update: {
                posts: {
                    update: {
                        where: { node: { title: { eq: "Version 7 Release Notes" } } }
                        node: { title: { set: "Version 7 Release Announcement" } }
                    }
                }
            }
        )
    }
  • #6124 d9cfd69 Thanks @angrykoala! - Fixed incorrect behavior of single and some filters on relationships to unions.

    Given the following union and relationship:

    union Production = Movie | Series

    and a relationship to this union:

    type Actor @node {
        name: String!
        actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT)
    }

    These queries previously returned incorrect results:

    query {
        actors(
            where: {
                actedIn: { single: { Movie: { title_CONTAINS: "The Office" }, Series: { title_ENDS_WITH: "Office" } } }
            }
        ) {
            name
        }
    }
    query {
        actors(
            where: {
                actedIn: { some: { Movie: { title_CONTAINS: "The Office" }, Series: { title_ENDS_WITH: "Office" } } }
            }
        ) {
            name
        }
    }

    Previously, conditions inside single and some were evaluated separately for each concrete type in the union, requiring all to match. This was incorrect.

    New behavior:

    • single: Now correctly returns actors with exactly one related node across the whole union, rather than per type.

    • some: Now correctly returns actors with at least one matching related node of any type in the union.

      This fix also applies to the deprecated filters actedIn_SINGLE and actedIn_SOME.

  • #6125 c51c9c0 Thanks @angrykoala! - Does not generate queries for interfaces without an implementing type with the @node directive.

    For example. The following type definitions:

    interface Production {
        title: String!
    }
    
    type Movie @node {
        title: String!
    }
    
    type NotANode implements Production {
        title: String!
    }

    Will no longer generate the queries and types related to the interface Production:

    type Query {
        productions(limit: Int, offset: Int, sort: [ProductionSort!], where: ProductionWhere): [Production!]!
        productionsConnection(
            after: String
            first: Int
            sort: [ProductionSort!]
            where: ProductionWhere
        ): ProductionsConnection!
    }
  • #6152 3e642d9 Thanks @darrellwarde! - The @query directive used on the schema will now also apply to the generation of queries for interface and union types.

    The following type definitions will not produce query fields for the Production or Media types.

    interface Production {
        title: String!
    }
    
    type Movie implements Production @node {
        title: String!
    }
    
    type Series implements Production @node {
        title: String!
    }
    
    union Media = Movie | Series
    
    extend schema @query(read: false, aggregate: false)
  • #6159 2adfdec Thanks @angrykoala! - Fails schema validation if an interface is implemented by a type with @node but not all implemented types use @node. For example, the following is invalid:

    interface Person {
        name: String
    }
    
    type Director implements Person {
        name: String
    }
    
    type Actor implements Person @node {
        name: String
    }
  • #6165 992c53a Thanks @angrykoala! - Fails schema validation if an union is composed of a type with @node but not all other types. For example, the following is invalid:

    union Person = Director | Actor
    
    type Director {
        name: String
    }
    
    type Actor @node {
        name: String
    }

Minor Changes

  • #6178 7aa1b95 Thanks @darrellwarde! - The Neo4j GraphQL Library is now bundled as a dual package containing both CommonJS and ESM builds. This is a changelog entry for #6177.

Patch Changes

  • #6154 5fedc91 Thanks @MacondoExpress! - Fixed a bug that allowed the queryName and fields arguments of the @fulltext directive to be undefined.

@neo4j/graphql@6.6.0

01 Apr 15:22
fc86e99
Compare
Choose a tag to compare

Minor Changes

  • #6110 100a603 Thanks @darrellwarde! - The where field for nested update operations has been deprecated to be moved within the update input field.
    The where in its deprecated location is a no-op for all nested operations apart from update.

    For example, the following mutation is using the deprecated syntax:

    mutation {
        updateUsers(
            where: { name: { eq: "Darrell" } }
            update: {
                posts: {
                    where: { node: { title: { eq: "Version 7 Release Notes" } } }
                    update: { node: { title: { set: "Version 7 Release Announcement" } } }
                }
            }
        )
    }

    It should be modified to move the where inside the update operation:

    mutation {
        updateUsers(
            where: { name: { eq: "Darrell" } }
            update: {
                posts: {
                    update: {
                        where: { node: { title: { eq: "Version 7 Release Notes" } } }
                        node: { title: { set: "Version 7 Release Announcement" } }
                    }
                }
            }
        )
    }

Patch Changes

  • #6126 7af4bbd Thanks @angrykoala! - Add overwriteArgument option to excludeDeprecatedFields to remove the argument overwrite from connect operations

@neo4j/graphql@6.5.3

26 Mar 10:29
828ac5e
Compare
Choose a tag to compare

Patch Changes

  • #6106 c3619e8 Thanks @mjfwebb! - Typescript version has been updated to 5.8.2 slightly changing the emitted code. This change is not expected to have any impact on the generated code or the runtime behavior of the library.

@neo4j/graphql@5.12.1

25 Mar 13:10
49b7daa
Compare
Choose a tag to compare

Patch Changes

  • #6105 11952fd Thanks @mjfwebb! - Typescript version has been updated to 5.8.2 slightly changing the emitted code. This change is not expected to have any impact on the generated code or the runtime behavior of the library.

@neo4j/graphql-ogm@5.12.1

25 Mar 13:10
49b7daa
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [11952fd]:
    • @neo4j/graphql@5.12.1

@neo4j/graphql@7.0.0-alpha.5

21 Mar 15:16
37f60bb
Compare
Choose a tag to compare
Pre-release

Patch Changes

  • #6099 d502b93 Thanks @mjfwebb! - Typescript version has been updated to 5.8.2 slightly changing the emitted code. This change is not expected to have any impact on the generated code or the runtime behavior of the library.

@neo4j/graphql@6.5.2

14 Mar 11:47
4d9dfee
Compare
Choose a tag to compare

Patch Changes

  • #6081 90d9b58 Thanks @angrykoala! - Fix missing authentication rules for interfaces in aggregate fields in connections.

@neo4j/graphql-amqp-subscriptions-engine@2.0.1

14 Mar 10:50
b46aa81
Compare
Choose a tag to compare

Patch Changes

@neo4j/graphql@7.0.0-alpha.4

14 Mar 13:20
98969a0
Compare
Choose a tag to compare
Pre-release

Major Changes

  • #6048 c667618 Thanks @darrellwarde! - Subscriptions are now an opt-in feature which can be enabled by using the @subscription directive on either schema or type.

    For example, to enable subscriptions for the whole schema (equivalent to before this breaking change):

    type Movie @node {
        title: String!
    }
    
    extend schema @subscription

    To enable subscriptions just for the Movie type:

    type Movie @node @subscription {
        title: String!
    }
  • #6077 4cf7c07 Thanks @darrellwarde! - Values specified within the @coalesce directive are now also returned when selecting those fields, and not just when those fields are used in a filter.

  • #6027 fd7d373 Thanks @angrykoala! - Remove deprecated fields *aggregate in favor of the aggregate field in connections. Remove option deprecatedAggregateOperations from the excludeDeprecatedFields setting.

Minor Changes

  • #6024 2318336 Thanks @MacondoExpress! - Aggregations filters are moved to the connection input field.

    Current aggregation filters:

    {
        posts(where: { likesConnection: { aggregate: { node: { someInt: { average: { eq: 10 } } } } } }) {
            content
        }
    }

    Deprecated aggregation filters:

    {
        posts(where: { likesAggregate: { node: { someInt: { average: { eq: 10 } } } } }) {
            content
        }
    }
  • #6024 2318336 Thanks @MacondoExpress! - The aggregation filter count now supports both, nodes and relationships.

    Count filter on nodes:

    {
        posts(where: { likesConnection: { aggregate: { count: { nodes: { eq: 2 } } } } }) {
            title
            likes {
                name
            }
        }
    }

    Count filter on edges:

    {
        posts(where: { likesConnection: { aggregate: { count: { edges: { eq: 2 } } } } }) {
            title
            likes {
                name
            }
        }
    }

Patch Changes

  • #6024 667e75c Thanks @MacondoExpress! - Following the changes of moving aggregations inside the connection fields,
    the previous aggregations filters outside the connection filters are now deprecated.

    The flag aggregationFiltersOutsideConnection has been added to the excludeDeprecatedFields setting.

    const neoSchema = new Neo4jGraphQL({
        typeDefs,
        features: { excludeDeprecatedFields: { aggregationFiltersOutsideConnection: true } },
    });
  • #6000 271a0a3 Thanks @MacondoExpress! - Add addVersionPrefix to cypherQueryOptions in context to add a Cypher version with CYPHER before each query:

    {
        cypherQueryOptions: {
            addVersionPrefix: true,
        },
    }

    This prepends all Cypher queries with a CYPHER [version] statement:

    CYPHER 5
    MATCH (this:Movie)
    WHERE this.title = $param0
    RETURN this { .title } AS this