Skip to content

Commit

Permalink
Remove private directive
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Dec 6, 2024
1 parent cebde09 commit 925ad8d
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 862 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-plants-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/graphql": major
---

Remove `@private` directive. This directive was intended to be used with the library `@neo4j/graphql-ogm` which is no longer supported.
1 change: 0 additions & 1 deletion packages/graphql/src/graphql/directives/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export { mutationDirective } from "./mutation";
export { nodeDirective } from "./node";
export { pluralDirective } from "./plural";
export { populatedByDirective } from "./populatedBy";
export { privateDirective } from "./private";
export { queryDirective } from "./query";
export { relationshipDirective } from "./relationship";
export { relationshipPropertiesDirective } from "./relationship-properties";
Expand Down
26 changes: 0 additions & 26 deletions packages/graphql/src/graphql/directives/private.ts

This file was deleted.

24 changes: 1 addition & 23 deletions packages/graphql/src/schema-model/generate-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ import type {
UnionTypeDefinitionNode,
} from "graphql";
import { Neo4jGraphQLSchemaValidationError } from "../classes";
import {
declareRelationshipDirective,
nodeDirective,
privateDirective,
relationshipDirective,
} from "../graphql/directives";
import { declareRelationshipDirective, nodeDirective, relationshipDirective } from "../graphql/directives";
import getFieldTypeMeta from "../schema/get-field-type-meta";
import { getInnerTypeName } from "../schema/validation/custom-rules/utils/utils";
import { isInArray } from "../utils/is-in-array";
Expand Down Expand Up @@ -207,11 +202,6 @@ function generateInterfaceEntity(
);

const fields = (definition.fields || []).map((fieldDefinition) => {
const isPrivateAttribute = findDirective(fieldDefinition.directives, privateDirective.name);

if (isPrivateAttribute) {
return;
}
const isRelationshipAttribute = findDirective(fieldDefinition.directives, declareRelationshipDirective.name);
if (isRelationshipAttribute) {
return;
Expand Down Expand Up @@ -438,11 +428,6 @@ function generateRelationshipField(
propertiesTypeName = properties;

const fields = (propertyInterface.fields || []).map((fieldDefinition) => {
const isPrivateAttribute = findDirective(fieldDefinition.directives, privateDirective.name);

if (isPrivateAttribute) {
return;
}
return parseAttribute(fieldDefinition, definitionCollection, propertyInterface.fields);
});

Expand Down Expand Up @@ -523,13 +508,6 @@ function generateConcreteEntity(
definitionCollection: DefinitionCollection
): ConcreteEntity {
const fields = (definition.fields || []).map((fieldDefinition) => {
// If the attribute is the private directive then
const isPrivateAttribute = findDirective(fieldDefinition.directives, privateDirective.name);

if (isPrivateAttribute) {
return;
}

const isRelationshipAttribute = findDirective(fieldDefinition.directives, relationshipDirective.name);
if (isRelationshipAttribute) {
return;
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/graphql/src/schema/validation/validate-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import { ValidFieldTypes } from "./custom-rules/valid-types/valid-field-types";
import { ValidListInNodeType } from "./custom-rules/valid-types/valid-list-in-node-type";
import { ValidObjectType } from "./custom-rules/valid-types/valid-object-type";
import { WarnIfAuthorizationFeatureDisabled } from "./custom-rules/warnings/authorization-feature-disabled";
import { WarnPrivateDeprecation } from "./custom-rules/warnings/deprecated-private";
import { WarnIfAMaxLimitCanBeBypassedThroughInterface } from "./custom-rules/warnings/limit-max-can-be-bypassed";
import { WarnObjectFieldsWithoutResolver } from "./custom-rules/warnings/object-fields-without-resolver";
import { WarnIfSubscriptionsAuthorizationMissing } from "./custom-rules/warnings/subscriptions-authorization-missing";
Expand Down Expand Up @@ -232,7 +231,6 @@ function runValidationRulesOnFilteredDocument({
}),
ValidListInNodeType,
WarnIfSubscriptionsAuthorizationMissing(Boolean(features?.subscriptions)),
WarnPrivateDeprecation(),
],
schema
);
Expand Down
129 changes: 0 additions & 129 deletions packages/graphql/tests/integration/issues/5066.int.test.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit 925ad8d

Please sign in to comment.