Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Trevor Scheer <[email protected]>
  • Loading branch information
abernix and trevor-scheer authored Apr 16, 2020
1 parent eec87a6 commit 0d31d1b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/apollo-server-core/src/requestPipelineAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,14 @@ export function whenResultIsFinished(

function forEachField(schema: GraphQLSchema, fn: FieldIteratorFn): void {
const typeMap = schema.getTypeMap();
Object.keys(typeMap).forEach(typeName => {
const type = typeMap[typeName];
Object.entries(typeMap).forEach(([typeName, type]) => {

if (
!getNamedType(type).name.startsWith('__') &&
type instanceof GraphQLObjectType
) {
const fields = type.getFields();
Object.keys(fields).forEach(fieldName => {
const field = fields[fieldName];
Object.entries(fields).forEach(([fieldName, field]) => {
fn(field, typeName, fieldName);
});
}
Expand Down

0 comments on commit 0d31d1b

Please sign in to comment.