How to use the @arcblock/sdk-util/lib/util.fakeField function in @arcblock/sdk-util

To help you get started, we’ve selected a few @arcblock/sdk-util 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 ArcBlock / forge-js / forge / graphql-client / tools / doc-util.js View on Github external
.reduce((obj, x) => {
      if (x.type.ofType) {
        if (x.type.kind === 'LIST') {
          obj[x.name] = [fakeField(x.type.ofType, typesMap)];
        } else if (x.type.ofType.kind === 'SCALAR') {
          obj[x.name] = fakeField(x.type.ofType, typesMap);
        } else if (['INPUT_OBJECT', 'OBJECT'].includes(x.type.ofType.kind)) {
          obj[x.name] = fakeMessage(typesMap[x.type.ofType.name], typesMap);
        } else {
          console.log('ignoreX', x);
        }
      } else if (x.type.kind === 'SCALAR') {
        obj[x.name] = fakeField(x.type, typesMap);
      }

      return obj;
    }, {});
github ArcBlock / forge-js / forge / graphql-client / tools / doc-util.js View on Github external
.reduce((obj, x) => {
      if (x.type.ofType) {
        if (x.type.kind === 'LIST') {
          obj[x.name] = [fakeField(x.type.ofType, typesMap)];
        } else if (x.type.ofType.kind === 'SCALAR') {
          obj[x.name] = fakeField(x.type.ofType, typesMap);
        } else if (['INPUT_OBJECT', 'OBJECT'].includes(x.type.ofType.kind)) {
          obj[x.name] = fakeMessage(typesMap[x.type.ofType.name], typesMap);
        } else {
          console.log('ignoreX', x);
        }
      } else if (x.type.kind === 'SCALAR') {
        obj[x.name] = fakeField(x.type, typesMap);
      }

      return obj;
    }, {});
github ArcBlock / forge-js / forge / graphql-client / tools / doc-util.js View on Github external
.reduce((obj, x) => {
      if (x.type.ofType) {
        if (x.type.kind === 'LIST') {
          obj[x.name] = [fakeField(x.type.ofType, typesMap)];
        } else if (x.type.ofType.kind === 'SCALAR') {
          obj[x.name] = fakeField(x.type.ofType, typesMap);
        } else if (['INPUT_OBJECT', 'OBJECT'].includes(x.type.ofType.kind)) {
          obj[x.name] = fakeMessage(typesMap[x.type.ofType.name], typesMap);
        } else {
          console.log('ignoreX', x);
        }
      } else if (x.type.kind === 'SCALAR') {
        obj[x.name] = fakeField(x.type, typesMap);
      }

      return obj;
    }, {});

@arcblock/sdk-util

Helpers and utilities shared across ArcBlock Javascript SDK

Apache-2.0
Latest version published 8 months ago

Package Health Score

53 / 100
Full package analysis