Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
use debug instead of console for info level
Browse files Browse the repository at this point in the history
  • Loading branch information
johnymontana committed Dec 11, 2019
1 parent a624d68 commit 5d72f5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/neo4j-schema/graphQLMapper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import schema from './entities';
import neo4jTypes from './types';
import _ from 'lodash';
import Debug from 'debug';

const debug = Debug('neo4j-graphql-js');

const relationDirective = (relType, direction) =>
`@relation(name: "${relType}", direction: "${direction}")`;
Expand All @@ -22,9 +25,7 @@ const mapOutboundRels = (tree, node, config) => {
// (:Customer)-[:BUYS]->(:Service)
// In this case, without type unions the destination type for :BUYS is ambiguous.
console.warn(
`RelID ${
rel.id
} for label set ${labels} has > 1 target type (${targetLabels}); skipping`
`RelID ${rel.id} for label set ${labels} has > 1 target type (${targetLabels}); skipping`
);
return null;
}
Expand Down Expand Up @@ -76,9 +77,7 @@ const mapInboundRels = (tree, node, config) => {

if (originLabels.length > 1) {
console.warn(
`RelID ${
rel.id
} for label set ${labels} has > 1 origin type (${originLabels}); skipping`
`RelID ${rel.id} for label set ${labels} has > 1 origin type (${originLabels}); skipping`
);
return null;
}
Expand Down Expand Up @@ -209,7 +208,8 @@ const mapRel = (tree, rel, config) => {
if (rel.isUnivalent()) {
if (!rel.hasProperties() && !config.alwaysIncludeRelationships) {
const rt = rel.getRelationshipType();
console.info(
debug(
'%s',
`Relationship :${rt} has no properties and does not need to be generated`
);
return '';
Expand Down

0 comments on commit 5d72f5a

Please sign in to comment.