Skip to content

Releases: neo4j/graphql

@neo4j/graphql@6.5.0

10 Mar 14:42
5ab5a54
Compare
Choose a tag to compare

Minor Changes

  • #6003 2952820 Thanks @angrykoala! - Add count fields in aggregations with support for nodes and edges count:

    query {
        moviesConnection {
            aggregate {
                count {
                    nodes
                }
            }
        }
    }
    query {
        movies {
            actorsConnection {
                aggregate {
                    count {
                        nodes
                        edges
                    }
                }
            }
        }
    }
  • #5944 a6e9486 Thanks @angrykoala! - Add aggregate field in connection:

    query {
        moviesConnection {
            aggregate {
                node {
                    count
                    int {
                        longest
                    }
                }
            }
        }
    }

Patch Changes

  • #5999 47f915e Thanks @angrykoala! - Deprecate aggregation fields (e.g actedInAggregate) in favor of the field aggregate inside the connection (e.g actedInConnection -> aggregate)

  • #5944 a6e9486 Thanks @angrykoala! - Deprecate old aggregate operations:

    query {
        moviesAggregate {
            count
            rating {
                min
            }
        }
    }

    These fields can be completely removed from the schema with the new flag deprecatedAggregateOperations:

    const neoSchema = new Neo4jGraphQL({
        typeDefs,
        features: { excludeDeprecatedFields: { deprecatedAggregateOperations: true } },
    });

@neo4j/graphql@6.4.0

07 Mar 15:31
a2a29ae
Compare
Choose a tag to compare

Minor Changes

  • #6029 f792a02 Thanks @darrellwarde! - Add a new field directive @sortable which can be used to configure whether results can be sorted by field values or not.

Patch Changes

  • #6046 dcf4c76 Thanks @angrykoala! - Add unsafeEscapeOptions to Neo4jGraphQL features with the following flags:

    • disableRelationshipTypeEscaping (default to false)

    • disableNodeLabelEscaping (defaults to false)

      These flags remove the automatic escaping of node labels and relationship types in the generated Cypher.

      For example, given the following schema:

      type Actor {
          name: String!
      }
      
      type Movie {
          title: String!
          actors: [Actor!]! @relationship(type: "ACTED IN", direction: OUT)
      }

      A GraphQL query going through the actors relationship:

      query {
          movies {
              title
              actors {
                  name
              }
          }
      }

      Will normally generate the following Cypher for the relationship:

      MATCH (this:Movie)-[this0:`ACTED IN`]->(this1:Actor)

      The label ACTED IN is escaped by placing it inside backticks (```), as some characters in it are susceptible of code injection.

      If the option disableRelationshipTypeEscaping is set in Neo4jGraphQL, this safety mechanism will be disabled:

      new Neo4jGraphQL({
          typeDefs,
          features: {
              unsafeEscapeOptions: {
                  disableRelationshipTypeEscaping: true,
              },
          },
      });

      Generating the following (incorrect) Cypher instead:

      MATCH (this:Movie)-[this0:ACTED IN]->(this1:Actor)

      This can be useful in very custom scenarios where the Cypher needs to be tweaked or if the labels and types have already been escaped.

      Warning: This is a safety mechanism to avoid Cypher injection. Changing these options may lead to code injection and an unsafe server.

  • #6042 9ff8a10 Thanks @MacondoExpress! - Fixed bug that causes connection fields for interfaces to not be able to be filtered using the typename filters.

@neo4j/graphql@5.12.0

06 Mar 16:30
51f8517
Compare
Choose a tag to compare

Minor Changes

  • #6033 48704e2 Thanks @darrellwarde! - Add a new field directive @sortable which can be used to configure whether results can be sorted by field values or not.

Patch Changes

  • #6043 d090d0b Thanks @angrykoala! - Add unsafeEscapeOptions to Neo4jGraphQL features with the following flags:

    • disableRelationshipTypeEscaping (default to false)
    • disableNodeLabelEscaping (defaults to false)

    These flags remove the automatic escaping of node labels and relationship types in the generated Cypher.

    For example, given the following schema:

    type Actor {
        name: String!
    }
    
    type Movie {
        title: String!
        actors: [Actor!]! @relationship(type: "ACTED IN", direction: OUT)
    }

    A GraphQL query going through the actors relationship:

    query {
        movies {
            title
            actors {
                name
            }
        }
    }

    Will normally generate the following Cypher for the relationship:

    MATCH (this:Movie)-[this0:`ACTED IN`]->(this1:Actor)

    The label ACTED IN is escaped by placing it inside backticks (```), as some characters in it are susceptible of code injection.

    If the option disableRelationshipTypeEscaping is set in Neo4jGraphQL, this safety mechanism will be disabled:

    new Neo4jGraphQL({
        typeDefs,
        features: {
            unsafeEscapeOptions: {
                disableRelationshipTypeEscaping: true,
            },
        },
    });

    Generating the following (incorrect) Cypher instead:

    MATCH (this:Movie)-[this0:ACTED IN]->(this1:Actor)

    This can be useful in very custom scenarios where the Cypher needs to be tweaked or if the labels and types have already been escaped.

    Warning: This is a safety mechanism to avoid Cypher injection. Changing these options may lead to code injection and an unsafe server.

  • #6041 c119004 Thanks @MacondoExpress! - Fixed bug that causes connection fields for interfaces to not be able to be filtered using the typename filters.

@neo4j/graphql-ogm@5.12.0

06 Mar 16:30
51f8517
Compare
Choose a tag to compare

Patch Changes

@neo4j/graphql@7.0.0-alpha.3

19 Feb 09:29
756ef0f
Compare
Choose a tag to compare
Pre-release

Major Changes

  • #5997 a716ef8 Thanks @angrykoala! - Remove publish method from Neo4jGraphQLSubscriptionsEngine interface as it is no longer used with CDC-based subscriptions. Implementing this method on custom engines will no longer have an effect, and it is no longer possible to call publish directly on Neo4jGraphQLSubscriptionsCDCEngine

  • #5976 7ddde75 Thanks @angrykoala! - Sets addVersionPrefix to true by default, this will prepend the Cypher version to all queries by default, ensuring that the correct Cypher version is used in Neo4j:

    CYPHER 5
    MATCH(this:Movie)

    This may be incompatible with older versions of Neo4j and can be disabled by setting cypherQueryOption.addVersionPrefix in the context to false:

    {
        cypherQueryOptions: {
            addVersionPrefix: true,
        },
    }

    For example, for an apollo server:

    await startStandaloneServer(server, {
        context: async ({ req }) => ({
            req,
            cypherQueryOptions: {
                addVersionPrefix: false,
            },
        }),
        listen: { port: 4000 },
    });

Patch Changes

@neo4j/graphql@6.3.1

18 Feb 09:50
e35d589
Compare
Choose a tag to compare

Patch Changes

  • #5952 4e14680 Thanks @angrykoala! - 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

@neo4j/graphql@5.11.5

12 Feb 10:03
7f2137f
Compare
Choose a tag to compare

Patch Changes

  • #5996 a5962ea Thanks @angrykoala! - Fix error "SchemaModel not available on subscription mechanism" with some subscriptions engines when used with Federation

  • #5969 80fb066 Thanks @angrykoala! - 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

@neo4j/graphql-ogm@5.11.5

12 Feb 10:03
7f2137f
Compare
Choose a tag to compare

Patch Changes

@neo4j/graphql@3.24.4

29 Jan 16:26
8023056
Compare
Choose a tag to compare

Important

This is an important patch release which ensures compatibility with the upcoming Neo4j 2025 release. Before you upgrade to Neo4j 2025, please ensure that you have applied this patch upgrade.

Patch Changes

@neo4j/graphql-ogm@3.24.4

29 Jan 16:26
8023056
Compare
Choose a tag to compare

Important

This is an important patch release which ensures compatibility with the upcoming Neo4j 2025 release. Before you upgrade to Neo4j 2025, please ensure that you have applied this patch upgrade.

Patch Changes