Admin GraphQL API docs have lots of incorrect information

Admin GraphQL API docs have lots of incorrect information

beedhoury
Visitor
2 0 1

I'm seeing multiple inconsistencies between the Admin GraphQL API docs and from trying to query the actual API. I'm looking at the latest API version (2024-07) docs and also using that API version when querying. Here's some of the issues I've run into so far:

 

1. On the LineItems object, there's a field called giftCard described in the docs. But when I try to query this field I get the following error:

 

 

 

{
    "errors": [
        {
            "message": "Field 'giftCard' doesn't exist on type 'LineItem'",
            "locations": [
                {
                    "line": 27,
                    "column": 21
                }
            ],
            "path": [
                "query Orders",
                "orders",
                "nodes",
                "lineItems",
                "nodes",
                "giftCard"
            ],
            "extensions": {
                "code": "undefinedField",
                "typeName": "LineItem",
                "fieldName": "giftCard"
            }
        }
    ]
}​

 

 

 

 

2. On the LineItems object, there's a field called price described in the docs. But when I try to query this field I get the similar error as above.

 

3. On the docs for LineItems, there's a "quantity" field but no "currentQuantity" field. In the actual API, I'm able to query both a "quantity" and "currentQuantity". What's the difference between the two fields?

 

4. On the docs for orders query, there's no mention of a "lineItems" field. But when I introspect the graphQL API, there is a "lineItems" field and I'm able to query it with pagination. In the docs there don't seem to be any way to query the line items belonging to an order.

 

Why am I not able to query fields that should exist according to the docs, and sometimes I'm able to query fields that don't exist according to the docs? Should I trust the docs or the API?

Replies 0 (0)