[solved] Get product options using graphql

Hi,

I’m trying to get the product options list using gql

I’m currently getting the variants using the following code, but I need the options instead

query getVariants($query: String, $first: Int, $cursor: String) {
  productVariants(query: $query, first: $first, after: $cursor) {
    edges {
      cursor
      node {
        id
        title
        selectedOptions {
          name
          value
        }
      }
    }
    pageInfo {
      hasNextPage
    }
  }
}

{
  "query": "product_id:XXXXXXXXXXXX",
  "first": 10
}

Is there a way to do it?

Thank you

I was able to read the options using

query getOptions($id: ID!) {
  product(id: $id) {
      options {
        name
      }
  }
}

{
  "id": "gid://shopify/Product/XXXXXXXXXX"
}