How to use the graphql-transformer-common.blankObject function in graphql-transformer-common

To help you get started, we’ve selected a few graphql-transformer-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 aws-amplify / amplify-cli / packages / graphql-connection-transformer / src / ModelConnectionTransformer.ts View on Github external
private generateModelXConnectionType(ctx: TransformerContext, typeDef: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): void {
        const tableXConnectionName = ModelResourceIDs.ModelConnectionTypeName(typeDef.name.value)
        if (this.typeExist(tableXConnectionName, ctx)) {
            return
        }

        // Create the ModelXConnection
        const connectionType = blankObject(tableXConnectionName)
        ctx.addObject(connectionType)

        ctx.addObjectExtension(makeModelConnectionType(typeDef.name.value))
    }
github aws-amplify / amplify-cli / packages / graphql-elasticsearch-transformer / src / SearchableModelTransformer.ts View on Github external
private generateSearchableXConnectionType(ctx: TransformerContext, def: ObjectTypeDefinitionNode): void {
    const searchableXConnectionName = `Searchable${def.name.value}Connection`;
    if (this.typeExist(searchableXConnectionName, ctx)) {
      return;
    }

    // Create the TableXConnection
    const connectionType = blankObject(searchableXConnectionName);
    ctx.addObject(connectionType);

    // Create TableXConnection type with items and nextToken
    let connectionTypeExtension = blankObjectExtension(searchableXConnectionName);
    connectionTypeExtension = extensionWithFields(connectionTypeExtension, [
      makeField('items', [], makeListType(makeNamedType(def.name.value))),
    ]);
    connectionTypeExtension = extensionWithFields(connectionTypeExtension, [
      makeField('nextToken', [], makeNamedType('String')),
      makeField('total', [], makeNamedType('Int')),
    ]);
    ctx.addObjectExtension(connectionTypeExtension);
  }
github aws-amplify / amplify-cli / packages / graphql-relation-transformer / src / ModelRelationTransformer.ts View on Github external
private generateModelXConnectionType(ctx: TransformerContext, typeDef: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): void {
        const tableXConnectionName = ModelResourceIDs.ModelConnectionTypeName(typeDef.name.value)
        if (this.typeExist(tableXConnectionName, ctx)) {
            return
        }

        // Create the ModelXConnection
        const connectionType = blankObject(tableXConnectionName)
        ctx.addObject(connectionType)

        ctx.addObjectExtension(makeModelConnectionType(typeDef.name.value))
    }
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / DynamoDBModelTransformer.ts View on Github external
private generateModelXConnectionType(ctx: TransformerContext, def: ObjectTypeDefinitionNode): void {
        const tableXConnectionName = ModelResourceIDs.ModelConnectionTypeName(def.name.value)
        if (this.typeExist(tableXConnectionName, ctx)) {
            return
        }

        // Create the ModelXConnection
        const connectionType = blankObject(tableXConnectionName)
        ctx.addObject(connectionType)

        ctx.addObjectExtension(makeModelConnectionType(def.name.value))
    }
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / lib / AppSyncDynamoDBTransformer.js View on Github external
AppSyncDynamoDBTransformer.prototype.generateModelXConnectionType = function (ctx, def) {
        var tableXConnectionName = definitions_1.makeModelConnectionTypeName(def.name.value);
        if (this.typeExist(tableXConnectionName, ctx)) {
            return;
        }
        // Create the ModelXConnection
        var connectionType = graphql_transformer_common_1.blankObject(tableXConnectionName);
        ctx.addObject(connectionType);
        ctx.addObjectExtension(definitions_1.makeModelConnectionType(def.name.value));
    };
    AppSyncDynamoDBTransformer.prototype.generateFilterInputs = function (ctx, def) {