Understanding GraphQL Scenario Comparison

The Platform allows querying the Data Service for scenario comparison purposes. For more details, please refer to Section Understanding the Data Service Scenario Comparison.

In the following example, Activity returns a list of one or more instances of the Activity and getActivityComparisonPage returns a paginated, sortable and filterable list of Activity instances

query {
    getActivityComparisonPage (
        geneContext: {
            scenarioIds: ["fbb146b1-3b7c-4564-b288-357fbee71d90"],
            referenceScenarioIds: ["01fbc776-dcc8-489d-9943-3b6785e876a2"]
        },
        geneComparisonParameters: {includeModifiedRows: DIFF,
        includeAddedRows: false,
        includeDeletedRows: false},
        dataRowsLimit: 50000,
        modifiedPageRequest: {page: 0, size: 50, sort: []}
    ){
        metrics {
            sharedRowCount
            modifiedRowCount
            addedRowCount
            deletedRowCount
        }
        modified {
            totalPages
            totalElements
            content {
                id
                plant {
                    country {
                        id
                    }
                    plantId
                 }
                durationInHours
                name
            }
        }
    }
}

The API returns the following result:

{
    "data": {
        "getActivityComparisonPage": {
            "metrics": {
                "sharedRowCount": 9000,
                "modifiedRowCount": 6009,
                "addedRowCount": 1000,
                "deletedRowCount": 1000
            },
            "modified": {
                "totalPages": 121,
                "totalElements": 6009,
                "content": [
                    {
                        "id": ["00000001", "00000001"],
                        "plant": {
                            "country": {
                                "id": ["001", "001"]
                            },
                            "plantId": ["001", "001"]
                        },
                        "durationInHours": [0.0, 2.0],
                        "name": ["Activity 0", "Activity 2"]
                    },
                    ...
                ]
            }
        }
    }
}