Skip to content

Commit

Permalink
Revert "feat(descriptors): add support for descriptors (#99)"
Browse files Browse the repository at this point in the history
This reverts commit 78ed906.
  • Loading branch information
jnwng committed Jun 22, 2017
1 parent 3c33cd9 commit c55ca40
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
10 changes: 0 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var parser = require('graphql/language/parser');
var buildASTSchema = require('graphql/utilities/buildASTSchema');

var parse = parser.parse;
var getDescription = buildASTSchema.getDescription;

// Strip insignificant whitespace
// Note that this could do a lot more, such as reorder fields etc.
Expand Down Expand Up @@ -85,14 +83,6 @@ function stripLoc(doc, removeLocAtThisLevel) {
});
}

if (!doc.description) {
var description = getDescription(doc);

if (description) {
doc.description = description;
}
}

if (docType !== '[object Object]') {
throw new Error('Unexpected input.');
}
Expand Down
16 changes: 0 additions & 16 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,21 +433,5 @@ const assert = require('chai').assert;
// `);
// });

describe('descriptors', function() {
it('adds comments as descriptors', function() {
const ast = gql`
# This is a type descriptor
type Foo {
# This is a field descriptor
bar: String
baz: Int
}
`;
assert.equal(ast.definitions[0].description, 'This is a type descriptor');
assert.equal(ast.definitions[0].fields[0].description, 'This is a field descriptor');
assert.equal(ast.definitions[0].fields[1].description, undefined);
})
})

});
});

0 comments on commit c55ca40

Please sign in to comment.