node_modules/graphql-compose/lib/InterfaceTypeComposer.js
/**
   * Prints SDL for current type. Or print with all used types if `deep: true` option was provided.
   */
Prints SDL for current type. Or print with all used types if `deep: true` option was provided.
Prints SDL for current type . Or print with all used types if ` deep : true ` option was provided .
toSDL(opts) {
    const _ref = opts || {},
          {
      deep
    } = _ref,
          innerOpts = _objectWithoutProperties(_ref, ["deep"]);
    const exclude = Array.isArray(innerOpts.exclude) ? innerOpts.exclude : [];
    if (deep) {
      let r = '';
      r += (0, _schemaPrinter.printInterface)(this.getType(), innerOpts);
      let nestedTypes = Array.from(this.getNestedTCs({
        exclude
      }));
      if ((opts === null || opts === void 0 ? void 0 : opts.sortAll) || (opts === null || opts === void 0 ? void 0 : opts.sortTypes)) {
        nestedTypes = nestedTypes.sort((a, b) => a.getTypeName().localeCompare(b.getTypeName()));
      }
      nestedTypes.forEach(t => {
        if (t !== this && !exclude.includes(t.getTypeName())) {
          const sdl = t.toSDL(innerOpts);
          if (sdl) r += `\n\n${sdl}`;
        }
      });
      return r;
    }
    return (0, _schemaPrinter.printInterface)(this.getType(), innerOpts);
  }
toSDL ( opts ) { const _ref = opts || { } , { deep } = _ref , innerOpts = _objectWithoutProperties ( _ref , [ "deep" ] ) ; const exclude = Array . isArray ( innerOpts . exclude ) ? innerOpts . exclude : [ ] ; if ( deep ) { let r = '' ; r += ( 0 , _schemaPrinter . printInterface ) ( this . getType ( ) , innerOpts ) ; let nestedTypes = Array . from ( this . getNestedTCs ( { exclude } ) ) ; if ( ( opts === null || opts === void 0 ? void 0 : opts . sortAll ) || ( opts === null || opts === void 0 ? void 0 : opts . sortTypes ) ) { nestedTypes = nestedTypes . sort ( ( a , b ) => a . getTypeName ( ) . localeCompare ( b . getTypeName ( ) ) ) ; } nestedTypes . forEach ( t => { if ( t !== this && ! exclude . includes ( t . getTypeName ( ) ) ) { const sdl = t . toSDL ( innerOpts ) ; if ( sdl ) r += ` \n \n ${ sdl } ` ; } } ) ; return r ; } return ( 0 , _schemaPrinter . printInterface ) ( this . getType ( ) , innerOpts ) ; }
Prints SDL for current type.
Prints SDL for current type .