Hello,
I am trying to get the return reason from ReturnLineItem schema using Python.
Here is what I have so far:
{
return_line_item(date_from: “2021-01-02”) {
complexity
data(first: 10){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
reason
}
}
}
}
}
I am getting the error that the attribute does not exist. I know sometimes that the attribute has a different name than what is shown in the public API schema.
Here is the schema that I see, written in Python:
class ReturnLineItem(sgqlc.types.Type):
__schema__ = sh_public_api_schema
__field_names__ = ('id', 'legacy_id', 'account_id', 'line_item_id', 'warehouse_id', 'product_id', 'return_id', 'quantity', 'quantity_received', 'restock', 'condition', 'is_component', 'type', 'reason', 'created_at', 'updated_at', 'line_item', 'warehouse')
id = sgqlc.types.Field(String, graphql_name='id')
legacy_id = sgqlc.types.Field(Int, graphql_name='legacy_id')
account_id = sgqlc.types.Field(String, graphql_name='account_id')
line_item_id = sgqlc.types.Field(String, graphql_name='line_item_id')
warehouse_id = sgqlc.types.Field(String, graphql_name='warehouse_id')
product_id = sgqlc.types.Field(String, graphql_name='product_id')
return_id = sgqlc.types.Field(String, graphql_name='return_id')
quantity = sgqlc.types.Field(Int, graphql_name='quantity')
quantity_received = sgqlc.types.Field(Int, graphql_name='quantity_received')
restock = sgqlc.types.Field(Int, graphql_name='restock')
condition = sgqlc.types.Field(String, graphql_name='condition')
is_component = sgqlc.types.Field(Boolean, graphql_name='is_component')
type = sgqlc.types.Field(String, graphql_name='type')
reason = sgqlc.types.Field(String, graphql_name='reason')
created_at = sgqlc.types.Field(ISODateTime, graphql_name='created_at')
updated_at = sgqlc.types.Field(ISODateTime, graphql_name='updated_at')
line_item = sgqlc.types.Field(LineItem, graphql_name='line_item')
warehouse = sgqlc.types.Field('Warehouse', graphql_name='warehouse')