@neo4j/graphql
Version:
A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations
49 lines • 2.42 kB
JavaScript
;
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.declareRelationshipDirective = exports.defaultNestedOperations = void 0;
const graphql_1 = require("graphql");
const constants_1 = require("../../constants");
const RelationshipNestedOperations_1 = require("./arguments/enums/RelationshipNestedOperations");
exports.defaultNestedOperations = [
constants_1.RelationshipNestedOperationsOption.CREATE,
constants_1.RelationshipNestedOperationsOption.UPDATE,
constants_1.RelationshipNestedOperationsOption.DELETE,
constants_1.RelationshipNestedOperationsOption.CONNECT,
constants_1.RelationshipNestedOperationsOption.DISCONNECT,
];
exports.declareRelationshipDirective = new graphql_1.GraphQLDirective({
name: "declareRelationship",
description: "Instructs @neo4j/graphql that any type that implements this interface must annotate this field with the `@relationship` directive. Allows for nested reading operations in the Interface top level query and opens up the ability to create and connect on this field.",
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION],
args: {
nestedOperations: {
type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(RelationshipNestedOperations_1.RelationshipNestedOperationsEnum))),
defaultValue: exports.defaultNestedOperations,
description: "Prevent all but these operations from being generated for this relationship",
},
aggregate: {
type: graphql_1.GraphQLBoolean,
defaultValue: true,
description: "Prevent aggregation for this relationship",
},
},
});
//# sourceMappingURL=declare-relationship.js.map