fulfillmentsV2, customAttributesV2 availability via GQL

Hi,

I’m attempting to access a customAttributesV2 value via a GQL (general structure below).

I get the following error:

"Field 'fulfillmentsV2' doesn't exist on type 'Order'"

Is there a workaround for this, or a plan to make the field available via API?

fulfillments & customAttributes are currently available but do not return the required values.

Many thanks,

Hamish

{
  orders {
    edges {
      node {
        fulfillmentsV2 {
          fulfillmentLineItems {
            nodes {
              id
              lineItem {
                customAttributesV2 {
                  key
                  value
                }
                id
                product {
                  customProductType
                  metafields {
                    edges
                    nodes
                  }
                }
              }
            }
            edges {
              node {
                lineItem {
                  customAttributesV2 {
                    key
                    value
                  }
                }
                id
              }
            }
            pageInfo
          }
          events
        }
      }
    }
    nodes {
      id
    }
  }
}

Hey there Hamish, I spent some time with GraphQL and it is confusing in general, but the below query may help in some way (I hope!). Explanation and code snippet below:

“Field ‘fulfillmentsV2’ doesn’t exist on type ‘Order’,” indicates that the fulfillmentsV2 field is not a valid field on the Order type in the Shopify GraphQL API. To work around this issue and access the customAttributesV2 value, let’s structure your GraphQL query a tad differently.

Revised query below!

{
  orders {
    edges {
      node {
        lineItems {
          edges {
            node {
              customAttributesV2 {
                key
                value
              }
              product {
                customProductType
                metafields {
                  edges {
                    node {
                      key
                      value
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
  • Query the orders field to retrieve a list of orders.
  • Navigate through the lineItems field to access individual line items within each order.
  • Now…we can access the customAttributesV2 field to retrieve the key and value of custom attributes.

Again, I am learning GraphQL in general along with the Shopify API’s, so I figured I’d take a stab at this. Let me know how it goes!

Thanks for your reply. Unfortunately I get an analogous error:

"Field 'customAttributesV2' doesn't exist on type 'LineItem'"

Using the GQL explorer (2024-01 version) I can’t see custom AttributesV2 or fulfillmentsV2 available at all.

NB I started my query by looking at the call made in the admin webpage & adjusted.

Ya you bet, I am not sure I have adequate knowledge of GraphQL to assist fully. I will run some queries in general and see if I can find anything for you though. With the question / prompt in mind: "I’m attempting to access a customAttributesV2 value via a GQL".

I’ll update this thread sometime today if I have some additional context for you.