node_modules/graphql-compose/lib/InterfaceTypeComposer.js
/**
   * Remove fields from type by name or array of names.
   * You also may pass name in dot-notation, in such case will be removed nested field.
   *
   * @example
   *     removeField('field1'); // remove 1 field
   *     removeField(['field1', 'field2']); // remove 2 fields
   *     removeField('field1.subField1'); // remove 1 nested field
   */
Remove fields from type by name or array of names.
You also may pass name in dot-notation, in such case will be removed nested field.


Remove fields from type by name or array of names . You also may pass name in dot - notation in such case will be removed nested field .
removeField(fieldNameOrArray) {
    const fieldNames = Array.isArray(fieldNameOrArray) ? fieldNameOrArray : [fieldNameOrArray];
    fieldNames.forEach(fieldName => {
      const names = fieldName.split('.');
      const name = names.shift();
      if (names.length === 0) {
        delete this._gqcFields[name];
      } else {
        if (this.hasField(name)) {
          const subTC = this.getFieldTC(name);
          if (subTC instanceof _ObjectTypeComposer.ObjectTypeComposer || subTC instanceof _EnumTypeComposer.EnumTypeComposer) {
            subTC.removeField(names.join('.'));
          }
        }
      }
    });
    return this;
  }
removeField ( fieldNameOrArray ) { const fieldNames = Array . isArray ( fieldNameOrArray ) ? fieldNameOrArray : [ fieldNameOrArray ] ; fieldNames . forEach ( fieldName => { const names = fieldName . split ( '.' ) ; const name = names . shift ( ) ; if ( names . length === 0 ) { delete this . _gqcFields [ name ] ; } else { if ( this . hasField ( name ) ) { const subTC = this . getFieldTC ( name ) ; if ( subTC instanceof _ObjectTypeComposer . ObjectTypeComposer || subTC instanceof _EnumTypeComposer . EnumTypeComposer ) { subTC . removeField ( names . join ( '.' ) ) ; } } } } ) ; return this ; }
Remove fields from type by name or array of names.
Remove fields from type by name or array of names .
// single field // nested field // eslint-disable-next-line no-lonely-if