Using the GraphQL Query Generator

Important:The built-in query generator, GraphQL Query Generator, is currently preview release functionality. Customers are encouraged to take advantage of the Customer Feedback button to identify ways we can improve the query generator, its components, and the documentation.

The GraphQL Query Generator is an embedded IDE that includes a built-in editor, a data model explorer, and a natural language processor (Query AI). In the query generator, you can quickly create, edit, and run queries. And once the query is run you can review the query output and choose to download the query results.

Important:The GraphQL Query Generator requires the following roles for non-admin users:

Query Graphql 
Manage Graph QL UI 
View IT Visibility 

For complete descriptions of each role available in Flexera One, see Flexera One Roles.

Tip:For efficiency when writing queries and reviewing query output, consider using the limit operator to restrict the query to a small number of records.

To use the GraphQL Query Generator

Click Dashboards > Technology Intelligence Data Explorer > GraphQL Query Generator.

This opens the GraphQL Query Generator. The query generator IDE includes an editor interface, a data model explorer, a natural language processor, an output pane, and a query results visualizer as well as other settings and controls.

To run a query in the GraphQL Query Generator

In the GraphQL Query Generator, type a query into the editor pane and click the Execute Query icon.

This icon runs the current query and shows the query results in JSON format in the output pane. (The output pane can render a maximum 256 KB of data. For larger query results, you must download the output as CSV to retrieve all of the data.)

The Execute Query icon.

Tip:If you are not highly skilled at writing GraphQL queries, consider using the built-in natural language processor (Query AI) to allow the GraphQL Query Generator to leverage its AI capabilities to generate the query for you.

Query Generator Components

The following table provides brief descriptions of the components within the GraphQL Query Generator IDE.

Component

Column Icons

Description

Editor Interface

none

The query generator includes an editor interface that experienced, technical users can work in to write their queries directly in the IDE.

When you open GraphQL Query Generator, the editor and output pane appear by default. Other components and functionality is accessible via the columns of icons on the left side and right side of the editor pane.

Output Pane

none

The query generator shows the query results as JSON data.

The output pane can render a maximum 256 KB of data. For larger query results, you must download the output as CSV to retrieve all of the data.

When you open GraphQL Query Generator, the editor and output pane appear by default. Other components and functionality is accessible via the columns of icons on the left side and right side of the editor pane.

Documentation Explorer

The query generator includes an explorer that allows you to browse and search the data model to better understand the attributes available to query and their relationships to each other.

History

Shows a list of recent queries you have run in the query generator.

Query AI

Provides a natural language processor prompt in which you can write a natural language request for a query and allow the IDE to craft the query syntax for you in the editor pane.

Then, you can build upon or edit the generated query as needed.

Query Results Visualizer

The query generator renders query output as a table below the editor interface. After your query runs, click the Generate Table icon in the column of icons on the right side of the editor pane. A Query Results Visualizer table renders the query results in a table format under the editor interface. You can filter and sort the table content. You can also page through the results and set the number of results to show per page.

Other Controls and Settings

various

The following controls appear in the column to the right side of the editor pane:

Execute Query—Runs the query currently in the editor pane.
Prettify Query—Cleans up the query syntax.
Merge Fragments into Query —Merges code fragments into the current query.
Copy Query—Copies the content of the current query.
Generate Table—Renders the current query output in tabular format under the query generator IDE on the same page.
Customer Feedback—Opens a simple customer feedback form to send feedback and requests related to the query generator to Flexera.
Download—Downloads the query results as a CSV file.

The following controls appear at the bottom of the column on the left side of the editor pane.

Re-fetch GraphQL Schema—Refreshes the data model/schema to which GraphQL Query Generator is linked.
Open Short Keys Dialog—Shows the shortcut keys available to you when you are using the GraphQL Query Generator.
Settings—Allows you to set the IDE theme for the GraphQL Query Generator, choose whether or not to persist headers, and clear storage.

 

 

 

Downloading Query Output

You can download your query results from the query generator as a CSV.

Tip:You can also copy the text in the GraphQL Query Generator’s output pane. The output pane contains the query results in JSON format.

To download query output as a CSV file:

On the GraphQL Query Generator page, click the Download icon.

The Download icon is located in the column of icons on the right side of the GraphQL Query Generator’s editor pane.

The Download icon.