Skip to content

Commit

Permalink
Merge pull request #93 from tlivings/master
Browse files Browse the repository at this point in the history
accept a config where exclude is not defined
  • Loading branch information
tlivings authored Mar 2, 2022
2 parents dcab31d + cd73f9e commit 0120f81
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@

### v3.0.1

- [FIXED] - if `exclude` is undefined in a component config

### v3.0.0

- Modernized to utilize new graphql-tools
- [BREAKING] - directives are not imported and maintained throughout the tree : top level component is responsible for directive implementations

### v2.2.0

- [FEATURE] - Add "hook" for custom `makeExecutableSchema` function
Expand Down
8 changes: 8 additions & 0 deletions lib/transforms/__tests__.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ const { exclusions } = require('./index.js');
const Test = require('tape');
const { FilterTypes, FilterObjectFields } = require('graphql-tools');

Test('exclusions() accepts null exclude arg', (t) => {
t.plan(1);

t.doesNotThrow(() => {
exclusions();
}, 'does not explode');
});

Test('exclusions() throws an error if passed a malformed exclusion', (t) => {
try {
exclusions(['mal.form.ed']);
Expand Down
2 changes: 1 addition & 1 deletion lib/transforms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { FilterTypes, FilterObjectFields } = require('graphql-tools');

const exclusions = function(exclusions) {
const exclusions = function(exclusions = []) {
return exclusions.map((exclusion) => {
if (typeof exclusion === 'string') {
const parts = exclusion.split('.');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-component",
"version": "3.0.0",
"version": "3.0.1",
"description": "Build, customize and compose GraphQL schemas in a componentized fashion",
"keywords": [
"graphql",
Expand Down

0 comments on commit 0120f81

Please sign in to comment.