@financial-times/biz-ops-schema
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -34,3 +34,4 @@ const rawData = require('../lib/raw-data'); | ||
endNode, | ||
isRecursive | ||
isRecursive, | ||
fieldset | ||
}) => ({ | ||
@@ -45,8 +46,13 @@ type: endNode, | ||
description, | ||
label | ||
label, | ||
fieldset | ||
}); | ||
const graphqlRelationships = relationships => { | ||
const graphqlRelationships = (relationships, properties) => { | ||
return relationships | ||
.filter(({ hidden }) => !hidden) | ||
.map(def => { | ||
def.fieldset = properties[def.name].fieldset | ||
return def | ||
}) | ||
.map(createGraphqlRelationship); | ||
@@ -81,3 +87,3 @@ }; | ||
if (structure === 'graphql') { | ||
relationships = graphqlRelationships(relationships); | ||
relationships = graphqlRelationships(relationships, type.properties); | ||
} | ||
@@ -84,0 +90,0 @@ return deepFreeze(relationships); |
{ | ||
"name": "@financial-times/biz-ops-schema", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Schema for biz-ops data store and api. It provides two things: - yaml files which define which types, properties and relationships are allowed - a nodejs library for extracting subsets of this information", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -361,3 +361,4 @@ const rawData = require('../../lib/raw-data'); | ||
description: 'test description', | ||
label: 'test label' | ||
label: 'test label', | ||
fieldset: undefined | ||
} | ||
@@ -379,3 +380,4 @@ ]); | ||
description: 'test description', | ||
label: 'test label' | ||
label: 'test label', | ||
fieldset: undefined | ||
} | ||
@@ -447,3 +449,4 @@ ]); | ||
description: 'test description', | ||
label: 'test label' | ||
label: 'test label', | ||
fieldset: undefined | ||
} | ||
@@ -465,3 +468,4 @@ ]); | ||
hasMany: true, | ||
name: 'many' | ||
name: 'many', | ||
fieldset: undefined | ||
}, | ||
@@ -477,3 +481,4 @@ { | ||
name: 'singular', | ||
hasMany: false | ||
hasMany: false, | ||
fieldset: undefined | ||
} | ||
@@ -480,0 +485,0 @@ ]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97681
2389