How to use the @fullstack-one/helper.helper.requireFilesByGlobPattern function in @fullstack-one/helper

To help you get started, we’ve selected a few @fullstack-one/helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fullstack-build / fullstack-one / packages / schema-builder / lib / db-schema-builder / graphql / index.ts View on Github external
const gQlSdlCombined = this.gQlSdl.concat(this.gQlSdlExtensions.slice()).join('\n');
      this.gQlAst = gQLHelper.helper.parseGraphQlSchema(gQlSdlCombined);

      this.dbMeta = parseGQlAstToDbMeta(this.gQlAst);

      // load permissions and expressions and generate views and put them into schemas
      try {

        // load permissions
        const viewsPattern = this.ENVIRONMENT.path + this.graphQlConfig.viewsPattern;
        const viewsArray = await helper.requireFilesByGlobPattern(viewsPattern);
        this.views = [].concat.apply([], viewsArray);

        // load expressions
        const expressionsPattern = this.ENVIRONMENT.path + this.graphQlConfig.expressionsPattern;
        const expressionsArray = await helper.requireFilesByGlobPattern(expressionsPattern);
        this.expressions = [].concat.apply([], expressionsArray);

        const viewSchemaName = Container.get(Config).getConfig('db').viewSchemaName;

        const combinedSchemaInformation = runtimeParser(this.gQlAst, this.views, this.expressions, this.dbMeta, viewSchemaName, this.parsers);

        this.gQlRuntimeDocument = combinedSchemaInformation.document;
        this.gQlRuntimeSchema = gQLHelper.helper.printGraphQlDocument(this.gQlRuntimeDocument);
        this.gQlTypes = combinedSchemaInformation.gQlTypes;
        this.queries = combinedSchemaInformation.queries;
        this.mutations = combinedSchemaInformation.mutations;

        this.customOperations = {
          fields: combinedSchemaInformation.customFields,
          queries: combinedSchemaInformation.customQueries,
          mutations: combinedSchemaInformation.customMutations
github fullstack-build / fullstack-one / packages / schema-builder / lib / db-schema-builder / graphql / index.ts View on Github external
this.logger.warn('boot.no.sdl.files.found');
        return;
      }

      // Combine all Schemas to a big one and add extensions from other modules
      const gQlSdlCombined = this.gQlSdl.concat(this.gQlSdlExtensions.slice()).join('\n');
      this.gQlAst = gQLHelper.helper.parseGraphQlSchema(gQlSdlCombined);

      this.dbMeta = parseGQlAstToDbMeta(this.gQlAst);

      // load permissions and expressions and generate views and put them into schemas
      try {

        // load permissions
        const viewsPattern = this.ENVIRONMENT.path + this.graphQlConfig.viewsPattern;
        const viewsArray = await helper.requireFilesByGlobPattern(viewsPattern);
        this.views = [].concat.apply([], viewsArray);

        // load expressions
        const expressionsPattern = this.ENVIRONMENT.path + this.graphQlConfig.expressionsPattern;
        const expressionsArray = await helper.requireFilesByGlobPattern(expressionsPattern);
        this.expressions = [].concat.apply([], expressionsArray);

        const viewSchemaName = Container.get(Config).getConfig('db').viewSchemaName;

        const combinedSchemaInformation = runtimeParser(this.gQlAst, this.views, this.expressions, this.dbMeta, viewSchemaName, this.parsers);

        this.gQlRuntimeDocument = combinedSchemaInformation.document;
        this.gQlRuntimeSchema = gQLHelper.helper.printGraphQlDocument(this.gQlRuntimeDocument);
        this.gQlTypes = combinedSchemaInformation.gQlTypes;
        this.queries = combinedSchemaInformation.queries;
        this.mutations = combinedSchemaInformation.mutations;