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<TypeName extends PrismaObjectTypeNames>(
  typeConfig: PrismaExtendTypeConfig<TypeName>,
  // @ts-ignore
): core.NexusWrappedType<core.NexusExtendTypeDef<TypeName>> {
  // @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<TypeName extends PrismaEnumTypeNames>(
  typeConfig: PrismaEnumTypeConfig<TypeName>,
): core.NexusWrappedType<core.NexusEnumTypeDef<TypeName>> {
  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<TypeName>,
): core.NexusWrappedType<core.NexusInputObjectTypeDef<TypeName>> {
  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<TypeName extends PrismaObjectTypeNames>(
  typeConfig: PrismaObjectTypeConfig<TypeName>,
): core.NexusWrappedType<core.NexusObjectTypeDef<TypeName>> {
  return core.nexusWrappedType(typeConfig.name, builder => {
    if (!isPrismaSchemaBuilder(builder)) {
      throw new Error('prismaObjectType can only be used by `makePrismaSchema`')
    }

    return nexusObjectType(typeConfig, builder)
  })
}