How to use the nexus.core.nexusWrappedType function in nexus

To help you get started, we’ve selected a few nexus 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 prisma-labs / nexus-prisma / packages / nexus-prisma / src / definitions / extendType.ts View on Github external
export function prismaExtendType(
  typeConfig: PrismaExtendTypeConfig,
  // @ts-ignore
): core.NexusWrappedType> {
  // @ts-ignore
  return core.nexusWrappedType(typeConfig.type, builder => {
    if (!isPrismaSchemaBuilder(builder)) {
      throw new Error('prismaExtendType can only be used by `makePrismaSchema`')
    }

    return nexusExtendType(typeConfig, builder)
  })
}
github prisma-labs / nexus-prisma / packages / nexus-prisma / src / definitions / enumType.ts View on Github external
export function prismaEnumType(
  typeConfig: PrismaEnumTypeConfig,
): core.NexusWrappedType> {
  return core.nexusWrappedType(typeConfig.name, builder => {
    if (!isPrismaSchemaBuilder(builder)) {
      throw new Error('prismaEnumType can only be used by `makePrismaSchema`')
    }

    return nexusEnumType(typeConfig, builder)
  })
}
github prisma-labs / nexus-prisma / packages / nexus-prisma / src / definitions / inputObjectType.ts View on Github external
export function prismaInputObjectType<
  TypeName extends PrismaInputObjectTypeNames
>(
  typeConfig: PrismaInputObjectTypeConfig,
): core.NexusWrappedType> {
  return core.nexusWrappedType(typeConfig.name, builder => {
    if (!isPrismaSchemaBuilder(builder)) {
      throw new Error(
        'prismaInputObjectType can only be used by `makePrismaSchema`',
      )
    }
    const prismaSchema = builder.getDatamodelInfo().schema

    return nexusInputObjectType(typeConfig, prismaSchema)
  })
}
github prisma-labs / nexus-prisma / packages / nexus-prisma / src / definitions / objectType.ts View on Github external
export function prismaObjectType(
  typeConfig: PrismaObjectTypeConfig,
): core.NexusWrappedType> {
  return core.nexusWrappedType(typeConfig.name, builder => {
    if (!isPrismaSchemaBuilder(builder)) {
      throw new Error('prismaObjectType can only be used by `makePrismaSchema`')
    }

    return nexusObjectType(typeConfig, builder)
  })
}