This topic tells you how to connect to the GraphQL playground and how to run some queries.
There are two ways you can perform GraphQL queries:
- Use the GraphQL playground
- Use curl
Use the GraphQL playground : Complete the following steps to perform GraphQL queries: 1. Enable ingress. VMware recommends enabling ingress. The Supply Chain Security Tools for Tanzu – Store and Artifact Metadata Repository (AMR) packages share the same ingress configuration. For information about enabling ingress, see Ingress support for Supply Chain Security Tools - Store. 1. Retrieve the access token. Run:
Use curl : Write and execute GraphQL queries to fetch data from the AMR. This procedure uses curl to query the AMR GraphQL endpoint, but you can use other similar tools to access the endpoint:
This section tells you about GraphQL query arguments, and lists the fields available for
AppAcceleratorRuns
and AppAcceleratorFragments
.
You can specify the following arguments when querying for AppAcceleratorRuns
. If you
don't specify an argument the query will return all AppAcceleratorRuns.
query
expects an object that specifies additional arguments to query.
| Argument | Description | Example |
|--------|---------|------------|------------|
|guid
|String value unique identifier for each AppAcceleratorRuns.|appAcceleratorRuns(query:{guid: "d2934b09-5d4c-45da-8eb1-e464f218454e"})
|
|source
|String representing the client used to run the accelerator. Supported values include TAP-GUI
, VSCODE
, and INTELLIJ
.|appAcceleratorRuns(query:{source: "TAP-GUI"})
|
|username
|String representing the user name of the person who runs the accelerator, as captured by the client UI.|appAcceleratorRuns(query:{username: "test.user"})
|
|namespace
and name
|Strings representing the accelerator that was used to create an application.|appAcceleratorRuns(query:{name: "tanzu-java-web-app"})
|
|appAcceleratorRepoURL
, appAcceleratorRevision
, and appAcceleratorSubpath
|Location in VCS (Version Control System) of the accelerator sources used.|appAcceleratorRuns(query:{appAcceleratorRepoURL: "https://github.com/vmware-tanzu/application-accelerator-samples.git", appAcceleratorRevision: "v1.6"
|
|timestamp
|String representation of the time the accelerator ran. You can query for runs that happened before
or after
a particular instant.|appAcceleratorRuns(query: {timestamp: {after: "2023-10-11T13:40:46.952Z"}}
)|
You can choose the following fields to return in the GraphQL query. You must specify at least one field.
guid
: String value unique identifier for each AppAcceleratorRuns.source
: String representing the client used to run the accelerator.username
: String representing the user name of the person who ran the accelerator.namespace
andname
: Strings representing the accelerator that was used to create an application.appAcceleratorRepoURL
,appAcceleratorRevision
, andappAcceleratorSubpath
: Location in VCS of the accelerator sources used.timestamp
: String representation of the time the accelerator ran.appAcceleratorSource
: VCS information of the sources of the accelerator used, but navigable as a commit.appAcceleratorFragments
: A one-to-many container of nodes representing the fragment versions used in eachAppAcceleratorRuns
. Fragment nodes share many of the fields withAppAcceleratorRuns
, with the same semantics but applied to the particular fragment. These include:namespace
andname
: Strings representing the identity of the fragment.appAcceleratorFragmentSourceRepoURL
,appAcceleratorFragmentSourceRevision
, andappAcceleratorFragmentSourceSubpath
: Location in VCS of the sources of the fragment usedappAcceleratorFragmentSource
: VCS information of the sources of the fragment, but navigable as a commit.
-
Get the list of all Application Accelerator runs, with the fragments used for each.
query getAllAcceleratorRuns { appAcceleratorRuns { nodes { name appAcceleratorFragments { nodes { name } } } } }