> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/attributes/llms.txt)
> Source: https://docs.saleor.io/api-reference/attributes/queries/attribute

# attribute Query

Look up an attribute by ID, slug or external reference.

```graphql
attribute(
  id: ID
  slug: String
  externalReference: String
): Attribute
```

Details

```graphql
type Attribute implements Node, ObjectWithMetadata {
  id: ID!
  privateMetadata: [MetadataItem!]!
  privateMetafield(
    key: String!
  ): String
  privateMetafields(
    keys: [String!]
  ): Metadata
  metadata: [MetadataItem!]!
  metafield(
    key: String!
  ): String
  metafields(
    keys: [String!]
  ): Metadata
  inputType: AttributeInputTypeEnum
  entityType: AttributeEntityTypeEnum
  referenceTypes(
    limit: PositiveInt = 100
  ): [ReferenceType!]
  name: String!
  slug: String!
  type: AttributeTypeEnum!
  unit: MeasurementUnitsEnum
  choices(
    sortBy: AttributeChoicesSortingInput
    filter: AttributeValueFilterInput
    where: AttributeValueWhereInput
    search: String
    before: String
    after: String
    first: Int
    last: Int
  ): AttributeValueCountableConnection
  valueRequired: Boolean!
  visibleInStorefront: Boolean!
  filterableInStorefront: Boolean! @deprecated
  filterableInDashboard: Boolean! @deprecated
  availableInGrid: Boolean! @deprecated
  storefrontSearchPosition: Int! @deprecated
  translation(
    languageCode: LanguageCodeEnum!
  ): AttributeTranslation
  withChoices: Boolean!
  productTypes(
    before: String
    after: String
    first: Int
    last: Int
  ): ProductTypeCountableConnection!
  productVariantTypes(
    before: String
    after: String
    first: Int
    last: Int
  ): ProductTypeCountableConnection!
  externalReference: String
}
```

<a id="arguments"></a>

### Arguments

<a id="id"></a>

#### [`id`](#id) ● [`ID`](/api-reference/miscellaneous/scalars/id.md)

ID of the attribute.

<a id="slug"></a>

#### [`slug`](#slug) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Slug of the attribute.

<a id="external-reference"></a>

#### [`externalReference`](#external-reference) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

External ID of the attribute.

<a id="type"></a>

### Type

<a id="attribute"></a>

#### [`Attribute`](/api-reference/attributes/objects/attribute.md)

Custom attribute of a product. Attributes can be assigned to products and variants at the product type level.
