How to use the feathers-hooks-common.setByDot function in feathers-hooks-common

To help you get started, we’ve selected a few feathers-hooks-common 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 Human-Connection / API / server / hooks / xss.js View on Github external
fields.forEach((field) => {
      // get item by dot notation
      const value = getByDot(items, field);
      // set cleaned item by dot notation
      setByDot(items, field, clean(value));
    });
  }
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongo.test-expected / src1 / services / graphql / batchloader.resolvers.ts View on Github external
return (parent: any, args: ArgMap, content: ResolverContext, ast: GraphQLResolveInfo) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns1 = batchLoader.load(parent[fieldName]);
      return !isArray ? returns1 : returns1.then((result: any) => result || []);
    };
  }
github feathers-plus / generator-feathers-plus / test / graphql.test-expected / src1 / services / graphql / batchloader.resolvers.js View on Github external
return (parent, args, content, ast) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns1 = batchLoader.load(parent[fieldName]);
      return !isArray ? returns1 : returns1.then(result => result || []);
    };
  }
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-2-sequelize-services.test-expected / src1 / services / graphql / batchloader.resolvers.ts View on Github external
return (parent: any, args: ArgMap, content: ResolverContext, ast: GraphQLResolveInfo) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns1 = batchLoader.load(parent[fieldName]);
      return !isArray ? returns1 : returns1.then((result: any) => result || []);
    };
  }
github feathers-plus / generator-feathers-plus / examples / js / 09-graphql / feathers-app / src / services / graphql / batchloader.resolvers.js View on Github external
return (parent, args, content, ast) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns1 = batchLoader.load(parent[fieldName]);
      return !isArray ? returns1 : returns1.then(result => result || []);
    };
  }
github Mattchewone / feathers-shallow-populate / lib / shallow-populate.js View on Github external
data.forEach(item => {
            const keyHere = getByDot(item, include.keyHere)

            if (keyHere) {
              if (Array.isArray(keyHere)) {
                if (!include.asArray) {
                  setByDot(item, include.nameAs, getRelatedItems(keyHere[0], relatedItems, include))
                } else {
                  setByDot(item, include.nameAs, getRelatedItems(keyHere, relatedItems, include))
                }
              } else {
                setByDot(item, include.nameAs, getRelatedItems(keyHere, relatedItems, include))
              }
            }
          })
        })
github feathers-plus / generator-feathers-plus / misc / authentication-template / app / services / graphql / batchloader.resolvers.js View on Github external
return (parent, args, content, ast) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns = batchLoader.load(parent[fieldName]);
      return !isArray ? returns : returns.then(result => result || []);
    };
  }
github feathers-plus / generator-feathers-plus / examples / ts / 09-graphql / feathers-app / src / services / graphql / batchloader.resolvers.ts View on Github external
return (parent: any, args: ArgMap, content: ResolverContext, ast: GraphQLResolveInfo) => {
      let batchLoader = getByDot(content, contentByDot);

      if (!batchLoader) {
        batchLoader = getBatchLoader(batchLoaderName, parent, args, content, ast);
        setByDot(content, contentByDot, batchLoader);
      }

      const returns1 = batchLoader.load(parent[fieldName]);
      return !isArray ? returns1 : returns1.then((result: any) => result || []);
    };
  }