12345678910111213141516171819 |
- Object.defineProperty(exports, "__esModule", { value: true });
- var graphql_1 = require("graphql");
- function forEachField(schema, fn) {
- var typeMap = schema.getTypeMap();
- Object.keys(typeMap).forEach(function (typeName) {
- var type = typeMap[typeName];
- // TODO: maybe have an option to include these?
- if (!graphql_1.getNamedType(type).name.startsWith('__') &&
- type instanceof graphql_1.GraphQLObjectType) {
- var fields_1 = type.getFields();
- Object.keys(fields_1).forEach(function (fieldName) {
- var field = fields_1[fieldName];
- fn(field, typeName, fieldName);
- });
- }
- });
- }
- exports.default = forEachField;
- //# sourceMappingURL=forEachField.js.map
|