Zend certified PHP/Magento developer

Magento 2 : What is typeResolver in GraphQL?

I am working on a custom module in which I’ve implemented graphql. One of the key in response contains different fields. For example, in the below json response the dynamic_fields content will depend on item_type and will be different.

"response" : {
    "items": {
        "item_id" : 1,
        "item_type" : "custom1"
        "dynamic_fields": {
            "custom_field1" : "data1"
            "custom_field2" : "data2"
        },
        "item_id" : 2,
        "item_type" : "custom2"
        "dynamic_fields": {
            "custom_field3" : "data3"
            "custom_field4" : "data4"
        },

    }
}

Can it be implemented using typeResolver? How to use typeResolver with TypeResolverInterface? Can it be used for dynamic types with inline fragmens?

Thanks in advance.