Closed Bhargavasrinivas closed 5 years ago
please try this code..
Storefront.QueryRootQuery query = Storefront.query(root -> root
.customer(accessToken, customer -> customer
.orders(arg -> arg.first(10), connection -> connection
.edges(edge -> edge
.node(node -> node
.orderNumber()
.totalPrice()
.email()
.phone()
.totalShippingPrice()
.totalTax()
.totalRefunded()
.currencyCode()
.customerUrl()
.statusUrl()
.processedAt()
.customerLocale()
.subtotalPrice()
)
)
)
)
);
QueryGraphCall call = graphClient.queryGraph(query);
call.enqueue(new GraphCall.Callback<Storefront.QueryRoot>() {
@Override
public void onResponse(@NonNull GraphResponse<Storefront.QueryRoot> response) {
for (int i = 0; i < response.data().getCustomer().getOrders().getEdges().size(); i++) {
Log.e("order", "order number.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getOrderNumber());
Log.e("order", "order id.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getId());
Log.e("order", "processedA.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getProcessedAt());
Log.e("order", "statusUrl.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getStatusUrl());
Log.e("order", "currencycode.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getCurrencyCode());
Log.e("order", "customerUrl.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getCustomerUrl());
Log.e("order", "totalTax.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getTotalTax());
Log.e("order", "totalShippingPrice.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getTotalShippingPrice());
Log.e("order", "customerLocale.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getCustomerLocale());
Log.e("order", "subtotalPrice.." + response.data().getCustomer().getOrders().getEdges().get(i).getNode().getSubtotalPrice());
}
}
@Override
public void onFailure(@NonNull GraphError error) {
Log.e("TAG", "Failed to execute query", error);
}
});
any query than please ask me....
Hi, I am new to Shopify and I am developing an android app using Shopify storefront APIs, I integrated the customer order api but the response is always null. Below is my code
Thanks in Advance.