Creating the GraphQL Query

Note: IT Visibility is being upgraded with the introduction of Technology Intelligence Platform beginning in September 2024. Flexera will contact you directly regarding the timeframe of your upgrade. If you have already been upgraded to Technology Intelligence Platform, information in this section is applicable to you.

This step involves creating a GraphQL query to specify the data that you want to retrieve from the server. Flexera One has defined queries that enable you to use the filter and search capabilities as required for the specific use cases. The primary filtering best practice involves exact matching of key fields (for example, id or name) as basic parameters. However, this approach does not cover advanced filtering and searching scenarios.

You can refer to the following GraphQL syntax for creating basic queries.

Example Query 1: Returns the name, serial number, domain, business unit, manufacturer name, and product name of 10 devices.

query{
  devices(limit: 10){
  name
  serialNumber
  domain
  businessUnit
  manufacturerName
  productName
  }
}

Example Query 2: Returns the name, serial number, domain, business unit, manufacturer name, and product name of 10 devices where the software installed is Microsoft. Also, returns the product name, version name, lifecycle, end of life, obsolete information of the installed software.

query{
  devices(limit: 10){
    name
    serialNumber
    domain
    businessUnit
    manufacturerName
    productName
    software (where: {manufacturerName: {eq: "Microsoft"}}){
      productName
      versionName
      lifecycle{
        endOfLife
        obsolete
      }
    }
  }
}

Example Query 3: Returns at least one software where the manufacturer name is Oracle and flattens the result.

query{
  # get 20 devices with Oracle software and flatten the result
  devices(limit: 20) @flatten {
    id
    name
    software(where: {manufacturerName: {startsWith: "Oracle"}}) @require {
      productName
    }
  }
}