The JFrog Evidence service provides a comprehensive GraphQL API for querying evidence and Release Bundle information. This API follows the OneModel GraphQL conventions and supports pagination, filtering, and federated queries.
Key features include:
Evidence management: Query and search evidence associated with artifacts.
Release Bundle queries: Access Release Bundle version, artifacts, and their relationships.
Pagination support: Cursor-based pagination for handling large result sets.
Filtering and ordering: Advanced filtering and sorting capabilities.
Federation support: Compatible with Apollo Federation for distributed architectures. Apollo Federation enables you to declaratively combine multiple APIs into a single federated GraphQL API.
This topic is divided into the following sections:
Evidence Schema
This section describes the Evidence schema, including:
Query Entry Points
Field | Type | Description | GraphQL |
|---|---|---|---|
evidence | EvidenceQueries | The main entry point for all evidence-related queries. |
|
Evidence Queries
getEvidenceById
Fetch specific evidence by its unique identifier.
Parameters:
id(String!, required): Unique identifier of the evidence.Returns: Evidence or null if not found.
query {
evidence {
getEvidenceById(id: "evidence-123") {
id
name
predicateType
createdBy
createdAt
}
}
}
getEvidence
Fetch evidence by repository key, path, name, and optional SHA-256 hash.
Parameters:
repositoryKey(String!, required): Repository key (e.g., my-repo-key).path(String!, required): Path within the repository (e.g., artifacts/path).name: (String!, required): Name of the evidence file (e.g., evidence.json).sha256: (Sha256, optional): SHA-256 hash of the evidence.
Returns: Evidence or null if not found.
query {
evidence {
getEvidence(
repositoryKey: "my-repo-key",
path: "artifacts/path",
name: "evidence.json"
) {
id
predicateType
verified
}
}
}
searchEvidence
Search for evidence with advanced filtering and pagination.
Parameters:
where(EvidenceWhereInput!, required): Filter specification.first(Int, optional): Number of items per page.after: (Cursor, optional): Cursor for pagination.
Returns:
EvidenceConnectionwithedges,pageInfo, andtotalCount.
query {
evidence {
searchEvidence(
where: {
hasSubjectWith: {
repositoryKey: "my-repo-key"
path: "artifacts/path"
}
}
first: 10
) {
totalCount
pageInfo {
hasNextPage
endCursor
}
edges {
cursor
node {
id
name
predicateType
createdBy
}
}
}
}
}
Input Types
Evidence GraphQL queries accept the following input types.
Input Type | Field | Type | Required | Description |
|---|---|---|---|---|
EvidenceWhereInput |
| EvidenceSubjectWhereInput! | Yes | Subject parameters to search for evidence. |
EvidenceSubjectWhereInput |
| String! | Yes | Repository key (e.g., my-repo-key). |
| String | No | Path of the subject (e.g., artifacts/path). | |
| String | No | Name of the subject (e.g., artifact-name). | |
| Sha256 | No | SHA-256 hash of the subject. | |
EvidenceSubjectToEvidenceWhereInput |
| String | No | Filter by predicate type. |
| Boolean | No | Filter by verification status. | |
| String | No | Filter by creator (e.g., user@example.com). | |
| String | No | Filter by stage name (e.g., qa, prod). | |
| Date | No | Filter by creation date range - from date (inclusive). Follows the ISO 8601 standard. For example: | |
| Date | No | Filter by creation date range - to date (inclusive). Follows the ISO 8601 standard. | |
EvidenceOrderInput |
| EvidenceOrderField! | Yes | Field to order by: |
| SortOrderDirection! | No | Direction to order by: |
Output Types
Evidence GraphQL queries feature the following output types.
Evidence
Represents artifact (subject) evidence.
Field | Type | Description |
|---|---|---|
| String | Unique identifier. |
| String | Path to download the evidence. |
| String | Name of the evidence. |
| Sha256 | SHA-256 hash. |
| String | Use |
| Associated subject of the evidence. | |
| String | Category of the predicate (e.g., distribution). |
| String | Predicate type. |
| JSON | Predicate data in JSON format. For more information, see Evidence Predicate. |
| Date | Creation date (e.g., 2024-11-05T13:15:30.972Z). |
| String | User who created the evidence. |
| Boolean | Whether the evidence is verified. |
| Signing key used to sign the evidence. | |
| String | The provider of the evidence (e.g., jfrog, sonar, github, and so on). |
| String | The stage in which the evidence was created. |
EvidenceSigningKey
Field | Type | Description |
|---|---|---|
| String | Alias of the signing key, as it is saved in Artifactory. |
| String | Base64 encoded public key used to verify the evidence signature. |
EvidenceSubject
Field | Type | Description |
|---|---|---|
| String | Repository key. |
| String | Full path to the file (<repositoryKey>/<path>/<name>). |
| EvidenceConnection | Evidence associated with this subject (supports filtering & ordering). |
Release Bundle Schema
This section describes the Release Bundle v2 schema. It is divided into the following subsections:
Query Entry Points
Field | Type | Description | GraphQL |
|---|---|---|---|
releaseBundleVersion | ReleaseBundleVersionQueries | The main entry point for Release Bundle v2 version queries. |
|
Release Bundle Queries
getVersion
Fetch a Release Bundle version by its key parameters.
Parameters:
name: (String!, required): Name of the Release Bundle.version(String!, required): Version of the Release Bundle.repositoryKey(String, optional): Repository key (default: release-bundles-v2).projectKey: (String, optional): Project key (will use the project's default repo, if provided).
Returns: ReleaseBundleVersion or null if not found.
query {
releaseBundleVersion {
getVersion(
name: "my-release-bundle",
version: "1.0.0"
) {
createdBy
createdAt
artifactsConnection(first: 10) {
totalCount
edges {
node {
name
path
packageType
}
}
}
}
}
}
Output Types
Release Bundle v2 GraphQL queries feature the following output types.
ReleaseBundleVersion
Represents a Release Bundle v2 version.
Field | Type | Description |
|---|---|---|
| String | Creator of the Release Bundle version. |
| Paginated connection for artifacts in the Release Bundle. | |
| Paginated connection for evidence associated with the Release Bundle. | |
| List of builds from which the Release Bundle was created. |
ReleaseBundleVersionArtifactConnection
Field | Type | Description |
|---|---|---|
| Wrapper for the artifact section. | |
| PageInfo | Pagination information. |
| Int | Total number of artifacts matching the query. |
Arguments:
Argument | Type | Description |
|---|---|---|
| Int | Number of items to return in a given page. Example: |
| Cursor | Exclusive cursor after which to fetch items in Base64. Example: |
| ReleaseBundleVersionArtifactWhenInput | Filtering criteria to show artifacts with evidence in it. Example: |
ReleaseBundleVersionArtifactEdge
Field | Type | Description |
|---|---|---|
| Artifact fields. | |
| Cursor | Cursor for pagination. |
ReleaseBundleVersionBuild
Represents a build within a ReleaseBundle version.
Field | Type | Description |
|---|---|---|
| String | Build name. |
| String | Build number. |
| Date | Timestamp when the build was executed (before actual deployment). |
| String | The build-info repository containing the build. |
| Paginated connection for evidence associated with this artifact. |
ReleaseBundleVersionArtifact
Represents an artifact within a Release Bundle version.
Field | Type | Description |
|---|---|---|
| String | Artifact path. |
| String | Artifact name. |
| Data | SHA-256 hash. |
| String | Package type (e.g., npm, maven). |
| String | Package name. |
| Int | Package size in bytes. |
| ReleaseBundleVersionArtifactProperty | Properties associated with the artifact. |
| Paginated connection for evidence associated with this artifact. |
EvidenceConnection and ArtifactConnection Wrapper Structure
The wrapper for evidenceConnection should have the following format:
evidenceConnection { totalCount edges { node { predicateSlug predicateType...}}}The wrapper for artifactConnection should have the following format:
artifactConnection { totalCount edges { node { path name ...}}}Common Types and Conventions
Pagination
The API uses Relay cursor-based pagination for all list queries.
Type | Field | Type | Description |
|---|---|---|---|
PageInfo | hasNextPage | Boolean | Whether there are more items after the current page. |
endCursor | Cursor | Cursor of the last items in the current page. | |
Cursor | String (opaque) | An opaque string used to fetch the next/previous page. |
Scalar Types
Type | Description | Example |
|---|---|---|
Date | Represents a date-time in ISO 8601 format. |
|
Sha256 | Represents a SHA-256 hash value (64 hex characters). |
|
JSON | Represents arbitrary JSON data. |
|
SortOrderDirection | Enum for sort order direction. |
|
Directives
Directive | Description | Usage Context |
|---|---|---|
@deprecated | Marks a field as deprecated with a reason. |
|
@experimental | Marks a field as experimental and subject to change. |
|
Query Examples
This section includes the following query examples:
Example 1: Search Evidence by Subject
Searches for evidence associated with a specific artifact as defined by its repository key, path, and name.
query SearchEvidenceBySubject {
evidence {
searchEvidence(
where: {
hasSubjectWith: {
repositoryKey: "my-docker-repo"
path: "images"
name: "my-app"
}
}
first: 20
) {
totalCount
pageInfo { hasNextPage, endCursor }
edges {
node {
id
name
predicateType
createdAt
verified
predicate
}
}
}
}
}
Example 2: Get Release Bundle with Artifacts and Evidence
Retrieves a specific Release Bundle v2 version, its associated artifacts (filtered for those with evidence), and the evidence for both the bundle and its artifacts.
query GetReleaseBundleWithDetails {
releaseBundleVersion {
getVersion(
name: "my-release-bundle"
version: "1.0.0"
) {
createdBy
createdAt
# Get artifacts in the release bundle
artifactsConnection(
where: { hasEvidence: true }
first: 50
) {
edges {
node {
name
sha256
sourceRepositoryPath
# Get evidence for each artifact
evidenceConnection(first: 10) {
totalCount
edges {
node {
id
predicateType
verified
}
}
}
}
}
}
# Get evidence for the release bundle itself
evidenceConnection(first: 10) {
edges {
node {
id
predicateType
verified
}
}
}
}
}
}
Application Version Query Example
For customers with AppTrust, the following example fetches an application version from the AppTrust service and retrieves its associated evidence (resolved by the Evidence service via federation).
Query:
query GetApplicationVersionWithEvidence {
applications {
getApplicationVersion(
applicationKey: "my-app"
version: "1.0.0"
) {
application {
key
displayName
}
version
tag
createdAt
createdBy
status
releaseStatus
# Evidence fields resolved by Evidence service via federation
evidence(first: 10, verified: true) {
id
name
predicateType
predicateCategory
verified
createdAt
createdBy
subject {
fullPath
repositoryKey
path
name
}
}
}
}
}
Response:
{
"data": {
"applications": {
"getApplicationVersion": {
"application": {
"key": "my-app",
"displayName": "My Application"
},
"version": "1.0.0",
"tag": "release-v1.0.0",
"createdAt": "2024-11-20T10:00:00Z",
"createdBy": "ci-system",
"status": "COMPLETED",
"releaseStatus": "RELEASED",
"evidence": [
{
"id": "evidence-123",
"name": "build-attestation",
"predicateType": "https://slsa.dev/provenance/v1",
"predicateCategory": "BUILD",
"verified": true,
"createdAt": "2024-11-20T10:15:00Z",
"createdBy": "ci-system",
"subject": {
"fullPath": "npm-local/artifacts/my-app/1.0.0",
"repositoryKey": "npm-local",
"path": "artifacts/my-app",
"name": "1.0.0"
}
}
]
}
}
}
}Best Practices
We recommend the following best practices when preparing Evidence GraphQL queries:
Use pagination for large result sets
Always specify
firstand use theaftercursor for subsequent pages to handle large result sets efficiently.Request only required fields
Request only the fields necessary to minimize response size and improve query performance. For example:
query { evidence { getEvidenceById(id: "123") { id predicateType verified } } }Use filters to narrow results
Apply filtering criteria (e.g., where arguments) directly in the GraphQL query instead of fetching large datasets and filtering in the application layer.
Use variables for dynamic queries
Define variables for dynamic values to make queries cleaner and reusable.
query GetEvidence($repoKey: String!, $path: String!, $name: String!) { evidence { getEvidence( repositoryKey: $repoKey path: $path name: $name ) { id verified } } }