How to use the graphql-compose.EnumTypeComposer.createTemp function in graphql-compose

To help you get started, we’ve selected a few graphql-compose 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 gridsome / gridsome / gridsome / lib / graphql / createSchema.js View on Github external
return ObjectTypeComposer.createTemp(options, schemaComposer)
    }
    case CreatedGraphQLType.Union:
      return UnionTypeComposer.createTemp(options, schemaComposer)

    case CreatedGraphQLType.Input:
      return InputTypeComposer.createTemp(options, schemaComposer)

    case CreatedGraphQLType.Scalar:
      return ScalarTypeComposer.createTemp(options, schemaComposer)

    case CreatedGraphQLType.Interface:
      return InterfaceTypeComposer.createTemp(options, schemaComposer)

    case CreatedGraphQLType.Enum:
      return EnumTypeComposer.createTemp(options, schemaComposer)
  }
}
github graphql-compose / graphql-compose-elasticsearch / src / ElasticApiParser.js View on Github external
result.false_boolean = { value: false };
        } else if (val === 'null') {
          result.null_string = { value: 'null' };
        } else if (Number.isFinite(val)) {
          result[`number_${(val: any)}`] = { value: val };
        } else if (typeof val === 'string') {
          result[val] = { value: val };
        }
        return result;
      }, {});

      let postfix = Object.keys(this.cachedEnums[key]).length;
      if (postfix === 0) postfix = '';
      else postfix = `_${postfix}`;

      this.cachedEnums[key][subKey] = EnumTypeComposer.createTemp({
        name: `${this.prefix}Enum_${upperFirst(fieldName)}${postfix}`,
        values,
      });
    }

    return this.cachedEnums[key][subKey];
  }