node_modules/@graphql-tools/utils/index.cjs.js
/**
 * Given a selectionSet, adds all of the fields in that selection to
 * the passed in map of fields, and returns it at the end.
 *
 * CollectFields requires the "runtime type" of an object. For a field which
 * returns an Interface or Union type, the "runtime type" will be the actual
 * Object type returned by that field.
 *
 * @internal
 */
Given a selectionSet, adds all of the fields in that selection to
the passed in map of fields, and returns it at the end.

CollectFields requires the "runtime type" of an object. For a field which
returns an Interface or Union type, the "runtime type" will be the actual
Object type returned by that field.

@internal
Given a selectionSet adds all of the fields in that selection to the passed in map of fields and returns it at the end . CollectFields requires the " runtime type " of an object . For a field which returns an Interface or Union type the " runtime type " will be the actual Object type returned by that field . @internal
function collectFields$1(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) {
    for (const selection of selectionSet.selections) {
        switch (selection.kind) {
            case graphql.Kind.FIELD: {
                if (!shouldIncludeNode(exeContext, selection)) {
                    continue;
                }
                const name = getFieldEntryKey(selection);
                if (!(name in fields)) {
                    fields[name] = [];
                }
                fields[name].push(selection);
                break;
            }
            case graphql.Kind.INLINE_FRAGMENT: {
                if (!shouldIncludeNode(exeContext, selection) ||
                    !doesFragmentConditionMatch(exeContext, selection, runtimeType)) {
                    continue;
                }
                collectFields$1(exeContext, runtimeType, selection.selectionSet, fields, visitedFragmentNames);
                break;
            }
            case graphql.Kind.FRAGMENT_SPREAD: {
                const fragName = selection.name.value;
                if (visitedFragmentNames[fragName] || !shouldIncludeNode(exeContext, selection)) {
                    continue;
                }
                visitedFragmentNames[fragName] = true;
                const fragment = exeContext.fragments[fragName];
                if (!fragment || !doesFragmentConditionMatch(exeContext, fragment, runtimeType)) {
                    continue;
                }
                collectFields$1(exeContext, runtimeType, fragment.selectionSet, fields, visitedFragmentNames);
                break;
            }
        }
    }
    return fields;
}
function collectFields$1 ( exeContext , runtimeType , selectionSet , fields , visitedFragmentNames ) { for ( const selection of selectionSet . selections ) { switch ( selection . kind ) { case graphql . Kind . FIELD : { if ( ! shouldIncludeNode ( exeContext , selection ) ) { continue ; } const name = getFieldEntryKey ( selection ) ; if ( ! ( name in fields ) ) { fields [ name ] = [ ] ; } fields [ name ] . push ( selection ) ; break ; } case graphql . Kind . INLINE_FRAGMENT : { if ( ! shouldIncludeNode ( exeContext , selection ) || ! doesFragmentConditionMatch ( exeContext , selection , runtimeType ) ) { continue ; } collectFields$1 ( exeContext , runtimeType , selection . selectionSet , fields , visitedFragmentNames ) ; break ; } case graphql . Kind . FRAGMENT_SPREAD : { const fragName = selection . name . value ; if ( visitedFragmentNames [ fragName ] || ! shouldIncludeNode ( exeContext , selection ) ) { continue ; } visitedFragmentNames [ fragName ] = true ; const fragment = exeContext . fragments [ fragName ] ; if ( ! fragment || ! doesFragmentConditionMatch ( exeContext , fragment , runtimeType ) ) { continue ; } collectFields$1 ( exeContext , runtimeType , fragment . selectionSet , fields , visitedFragmentNames ) ; break ; } } } return fields ; }
Given a selectionSet, adds all of the fields in that selection to
 the passed in map of fields, and returns it at the end.
Given a selectionSet adds all of the fields in that selection to the passed in map of fields and returns it at the end .