For Check What is GraphQL in Magento 2, Read Blog, GraphQl in Magento 2
Check the link, Get List of Orders of Customer using GraphQl Magento 2 full module
For Get List of orders of Customer by customer id, You need to create a schema file for getting a response from Query.
In above you have declared schema file for getting multiple records of order for a specific customer.
type SalesOrder @doc(description: "Sales Order graphql gather Data of specific order information") {
order_array: [String] @doc(description: "Array of order list.") }
In above order_array is used for getting an array of records but in your resolver, you made mistakes for multiple records.
In $orderCollection[] you need to pass array key for each record and you forgot to add that in your code.
You can try with,
foreach($orders as $k => $order) {
$orderCollection['order_array'][$k] = [
'increment_id' => $order->getIncrementId(),
'grand_total' => $order->getGrandTotal(),
'customer_id' => $order->getCustomerId(),
];
}
Let me know if you have any query.