Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegraphql
query envState($where: [WhereInput], $sort: [SortInput], $page: PageInput) {
    reportEnvironmentState(where: $where, sort: $sort, page: $page) {
        next
        hasMore
        items {
            endTime
            environmentName
            executionStatus
            externalTicket
            instanceName
            objectPath
            packageName
            partialDeployments
            projectName
            projectVersionName
            projectWorkflowType
            relName
            relSnapshot
            scmRevision
            startTime
            streamName
            workflowExecutionId
            workflowRequestId
        }
    }
}

Variables

There are three main variables to use with FlexDeploy GraphQL queries: where, sort, and page.

...

Code Block
items {
            endTime
            environmentName
            executionStatus
            externalTicket
            instanceName
            objectPath
            packageName
            partialDeployments
            projectName
            projectVersionName
            projectWorkflowType
            relName
            relSnapshot
            scmRevision
            startTime
            streamName
            workflowExecutionId
            workflowRequestId
        }

Here is where we can control what is being returned in the query. GraphQL will only return fields present in the subselection. For example, If i only wanted Package Name, Project Name and Project Version Name to be returned, I could alter our previous example to something like this:

Code Block
query envState($where: [WhereInput], $sort: [SortInput], $page: PageInput) {
    reportEnvironmentState(where: $where, sort: $sort, page: $page) {
        next
        hasMore
        items {
            packageName
            projectName
            projectVersionName
        }
    }
}

Example Queries:

Here are are few more examples of queries that you can use with FlexDeploy. To get a full list of queries, some software used to execute queries like postman can give auto correct advice by fetching out GraphQL schema automatically. Otherwise, an Introspection Query can provide a list of queries accessible in our schema.

Environment History Report With File Details

Code Block
query envState($where: [WhereInput], $sort: [SortInput], $page: PageInput) {
    reportEnvironmentHistoryFileDetails(where: $where, sort: $sort, page: $page) {
        next
        hasMore
        items {
            allFilesRequested
            buildFlexField1
            buildFlexField10
            buildFlexField2
            buildFlexField3
            buildFlexField4
            buildFlexField5
            buildFlexField6
            buildFlexField7
            buildFlexField8
            buildFlexField9
            cmsTicketIds
            endTime
            environmentId
            environmentName
            executionStatus
            flexField1
            flexField10
            flexField2
            flexField3
            flexField4
            flexField5
            flexField6
            flexField7
            flexField8
            flexField9
            folderId
            instanceId
            instanceName
            workItemIds
            objectPath
            packageName
            partialDeployments
            pkgStatus
            poScmRevision
            projectId
            projectName
            projectVersionName
            relDefinitionId
            relName
            relSnapshot
            relSnapshotId
            requestedBy
            requestedOn
            scmRevision
            sequenceNumber
            stageExecId
            startTime
            streamName
            workflowExecutionId
            workflowId
            workflowRequestId
            workflowType
            workflowVersion
        }
    }
}

Environment History Report Without File Details

Code Block
query envState($where: [WhereInput], $sort: [SortInput], $page: PageInput) {
    reportEnvironmentHistoryNoFileDetails(where: $where, sort: $sort, page: $page) {
        next
        hasMore
        items {
            allFilesRequested
            buildFlexField1
            buildFlexField10
            buildFlexField2
            buildFlexField3
            buildFlexField4
            buildFlexField5
            buildFlexField6
            buildFlexField7
            buildFlexField8
            buildFlexField9
            cmsTicketIds
            endTime
            environmentId
            environmentName
            executionStatus
            flexField1
            flexField10
            flexField2
            flexField3
            flexField4
            flexField5
            flexField6
            flexField7
            flexField8
            flexField9
            folderId
            instanceId
            instanceName
            workItemIds
            objectPath
            packageName
            partialDeployments
            pkgStatus
            poScmRevision
            projectId
            projectName
            projectVersionName
            relDefinitionId
            relName
            relSnapshot
            relSnapshotId
            requestedBy
            requestedOn
            scmRevision
            sequenceNumber
            stageExecId
            startTime
            streamName
            workflowExecutionId
            workflowId
            workflowRequestId
            workflowType
            workflowVersion
        }
    }
}

Executing Queries

Combing everything we talked about this far, we are now able to execute queries.

...

Once a query is configured inside your software of choice to make HTTP requests, just press the “Send” or “Execute” button to send out your HTTP Request.