-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unsafeEscapeOptions #6043
Add unsafeEscapeOptions #6043
Conversation
🦋 Changeset detectedLatest commit: 847e7bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Performance ReportNo Performance Changes Show Full Table
Old Schema Generation: 27.675s |
6b43fc0
to
1fb21da
Compare
packages/graphql/src/translate/authorization/compatibility/compile-predicate-return.ts
Outdated
Show resolved
Hide resolved
Following the change in neo4j/cypher-builder#513 Update cypher builder on this PR and update |
7d94eda
to
ac38c25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Add
unsafeEscapeOptions
toNeo4jGraphQL
features with the following flags:disableRelationshipTypeEscaping
(default tofalse
)disableNodeLabelEscaping
(defaults tofalse
)These flags remove the automatic escaping of node labels and relationship types in the generated Cypher.
For example, given the following schema:
A GraphQL query going through the
actors
relationship:Will normally generate the following Cypher for the relationship:
The label
FROM_PRODUCTION]->(:Production)-[: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 inNeo4jGraphQL
, this safety mechanism will be disabled:Generating the following Cypher instead:
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.