@neo4j/graphql@4.0.0
版本发布时间: 2023-09-01 22:07:56
neo4j/graphql最新发布版本:@neo4j/graphql@5.7.0(2024-09-27 22:43:48)
Major Changes
-
#2773
7462b9715
Thanks @angrykoala! - The deprecated@callback
directive has been removed. Any remaining usages of@callback
should be replaced with@populatedBy
. See https://github.com/neo4j/graphql/blob/dev/docs/modules/ROOT/pages/guides/v4-migration/index.adoc#callback-renamed-to-populatedby for more information. -
#2773
7462b9715
Thanks @angrykoala! - Remove aggregation fields for relationships to a single node (non-List relationships) - these serve no functional utility -
#2773
7462b9715
Thanks @angrykoala! - Theoperations
argument of@subscription
has been renamed toevents
, with each event being past tense. This mirrors naming used elsewhere for subscriptions. -
#2773
7462b9715
Thanks @angrykoala! - Support for Neo4j database 4.3 has been dropped. Please use the current Neo4j 5 release, or the LTS 4.4 release. -
#2773
7462b9715
Thanks @angrykoala! - Aliased properties are now automatically escaped using backticks. If you were using backticks in theproperty
argument of your@alias
directives, these should now be removed. -
#2773
7462b9715
Thanks @angrykoala! - Deprecated @node directive argumentslabel
andadditionalLabels
have been removed. Please use thelabels
argument. -
#2773
7462b9715
Thanks @angrykoala! - Removenodes
andrelationships
from the public API of theNeo4jGraphQL
class. -
#2773
7462b9715
Thanks @angrykoala! - Specifying Cypher query options to be used is nowcypherQueryOptions
instead of justqueryOptions
, and each option accepts a simple string rather than an enum. -
#2773
7462b9715
Thanks @angrykoala! - Escape properties and relationships if needed, using | and & as part of the label is no longer supported -
#2773
7462b9715
Thanks @angrykoala! - skipValidateTypeDefs has been removed. Please use startupValidation instead. See https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#startup-validation -
#2773
7462b9715
Thanks @angrykoala! - It was possible to define schemas with types that have multiple relationship fields connected by the same type of relationships. Instances of this scenario are now detected during schema generation and an error is thrown so developers are informed to remedy the type definitions.An example of what is now considered invalid with these checks:
type Team { player1: Person! @relationship(type: "PLAYS_IN", direction: IN) player2: Person! @relationship(type: "PLAYS_IN", direction: IN) backupPlayers: [Person!]! @relationship(type: "PLAYS_IN", direction: IN) } type Person { teams: [Team!]! @relationship(type: "PLAYS_IN", direction: OUT) }
For more information about this change and how to disable this validation please see the 4.0.0 migration guide
-
#2773
7462b9715
Thanks @angrykoala! - The Neo4j GraphQL Library now only accepts astring
,DocumentNode
or an array containing these types. A callback function returning these is also accepted. This is a reduction fromTypeSource
which also included types such asGraphQLSchema
andDefinitionNode
, which would have resulted in unexpected behaviour if passed in. -
#2773
7462b9715
Thanks @angrykoala! - Removed deprecated argumentplural
from@node
directive. Please use the@plural
directive instead. -
#2773
7462b9715
Thanks @angrykoala! - Removal of the following exports:Neo4jGraphQLAuthenticationError
,Neo4jGraphQLForbiddenError
,EventMeta
,Neo4jGraphQLAuthPlugin
andRelationField
. This are either redundant, or internals which shouldn't have been exported. -
#2773
7462b9715
Thanks @angrykoala! - Remove unusedDeleteInfo
,GraphQLSortArg
,GraphQLOptionsArg
andGraphQLWhereArg
type exports. -
#2773
7462b9715
Thanks @angrykoala! - Thelimit
argument of the@queryOptions
directive has been moved to its own directive,@limit
. -
#2773
7462b9715
Thanks @angrykoala! - Programmatic toggling of debug logging is now done using thedebug
option of the constructor. -
#2773
7462b9715
Thanks @angrykoala! - Change subscriptions setup, this requires changes to constructor options passed to Neo4jGraphQL. See https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#subscriptions-optionsFor single instance subscriptions use
true
:const neoSchema = new Neo4jGraphQL({ typeDefs, features: { subscriptions: true, }, });
For any other plugin, pass it
features.subscriptions
:const neoSchema = new Neo4jGraphQL({ typeDefs, features: { subscriptions: subscriptionPlugin, }, });
-
#2773
7462b9715
Thanks @angrykoala! - The minimum version ofneo4j-driver
is now5.8.0
, please upgrade. Theboomkark
field in the selection set has been marked as deprecated and will be removed in version5.0.0
of the library. -
#2773
7462b9715
Thanks @angrykoala! - Therequires
argument of the@customResolver
directive now accepts a graphql selection set. This means it is now possible to require non-scalar fields such as related types. -
#2773
7462b9715
Thanks @angrykoala! -@cypher
directive now requires the parametercolumnName
.This requires all cypher queries to be made with a valid alias that must be referred in this new parameter.
For Example:
@neo4j/graphql@3
@cypher(statement: "MATCH (i:Item) WHERE i.public=true RETURN i.name")
@neo4j/graphql@4
@cypher(statement: "MATCH (i:Item) WHERE i.public=true RETURN i.name as result", columnName: "result")
-
#2773
7462b9715
Thanks @angrykoala! -neo4jDatabaseInfo
has been removed from the context. It is our belief that this has little utility in the library. If you regularly use different drivers connected to different versions of Neo4j and require this feature, please raise an issue: https://github.com/neo4j/graphql/issues/new/choose -
#2773
7462b9715
Thanks @angrykoala! - The@id
directive has had a number of breaking changes.The
unique
argument has been removed. In an effort to simplify directives,@id
will now only only be responsible for the autogeneration of UUID values. If you would like the property to also be backed by a unique node property constraint, use the@unique
directive alongside@id
.The
autogenerate
argument has been removed. With this value set tofalse
and the above removal of constraint management, this would make the directive a no-op.The
global
argument has been removed. This quite key feature of specifying the globally unique identifier for Relay was hidden away inside the@id
directive. This functionality has been moved into its own directive,@relayId
, which is used with no arguments. The use of the@relayId
directive also implies that the field will be backed by a unique node property constraint.Note, if using the
@id
and@relayId
directive together on the same field, this will be an autogenerated ID compatible with Relay, and be backed by a single unique node property constraint. If you wish to give this constraint a name, use the@unique
directive also with theconstraintName
argument. -
#2773
7462b9715
Thanks @angrykoala! - Made@relationshipProperties
mandatory for relationship property interfaces -
#2773
7462b9715
Thanks @angrykoala! - config.callbacks has been deprecated and replaced with features.populatedBy.callbacks. See https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#_callback_renamed_to_populatedby for more information. -
#2773
7462b9715
Thanks @angrykoala! - Validation of type definitions is now configured using thevalidate
boolean option in the constructor, which defaults totrue
. -
#2773
7462b9715
Thanks @angrykoala! - Use driver default access mode "READ" for@cypher
directives in theQuery
type, and "WRITE" in theMutation
type. -
#2773
7462b9715
Thanks @angrykoala! - Removed@computed
directive. Please use@customResolver
instead. -
#2773
7462b9715
Thanks @angrykoala! - Remove all arguments from IExecutableSchemaDefinition apart fromtypeDefs
andresolvers
. This is to simplify the API and to remove any unexpected behaviours from arguments which we blindly pass through. -
#2773
7462b9715
Thanks @angrykoala! - All labels and field names are escaped in the generated Cypher -
#2773
7462b9715
Thanks @angrykoala! -enableRegex
has been removed and replaced withMATCHES
filters in the features configuration object. See the migration guide for more information: https://neo4j.com/docs/graphql-manual/current/guides/v4-migration -
#2773
7462b9715
Thanks @angrykoala! - Relationship type strings are now automatically escaped using backticks. If you were using backticks in thetype
argument of your@relationship
directives, these should now be removed to avoid backticks being added into your relationship type labels. -
#2773
7462b9715
Thanks @angrykoala! -cypherQueryOptions
moved into context-only, as a per-request option.
Minor Changes
-
#2773
7462b9715
Thanks @angrykoala! - The evaluation of authorization rules is now supported when using the Neo4j GraphQL Library as a Federation Subgraph.
Patch Changes
-
#2773
7462b9715
Thanks @angrykoala! -cypherParams
in the context now work as expected when using the OGM -
#2773
7462b9715
Thanks @angrykoala! -cypherParams
added to theNeo4jGraphQLContext
type, and the fields within it can be referred to directly.