#Expand customer by customer group not working (storefront)

1 messages · Page 1 of 1 (latest)

sudden wigeon
#

When I try to fetch a customer including their customer group(s) I get a validation error on the server.

This is my call:

 return await sdk.client
    .fetch<{ customer: StoreCustomer }>(`/store/customers/me`, {
      method: "GET",
      query: {
        fields: "*customer_group",
      },
      headers,
      next,
    })
    .then(({ customer }) => customer)
    .catch(() => null)
}

My backend throws an error:

error: Requested fields [customer_group] are not valid

What am I missing here? How else am I supposed to fetch a customers group from the storefront.

Is there an overview of all relations I can call for a specific entity? Would be great if this was typed and not simply a string

sudden wigeon
#

Anyone?

sudden wigeon
#

bump

kindred crystal
sudden wigeon
#

Thanks for replying but this is also not correct:

error: Requested fields [groups] are not valid

When I extent the /store/customers/meroute like *groups

sudden wigeon
#

Does anyone know? Crucial for us

sudden wigeon
#

bump