Use One Model GraphQL

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Using One Model, you can access all supported domains using the following unified endpoint:

POST <your-jfrog-domain>/onemodel/api/v1/graphql

Note

JFrog One Model GraphQL currently supports the POST with JSON format. For more information, see the GraphQL documentation for Request Format and Response Format.

To use the One Model endpoint, execute your query using curl or an API client application such as Postman- see some simple examples below. For more information on queries and parameters you can use, see the One Model sections for the supported domains:

Usage Examples

Query Example

Use the following query to get the first 5 evidences from the repository “example-repo-local”:

query {
  evidence {
    searchEvidence(first: 5, where: {
        hasSubjectWith: {
          repositoryKey: "example-repo-local", 
          path: "path/to", 
          name: "file.ext"}}) {
      edges {
        node {
          predicateSlug
          predicateType
          predicate
          verified
          downloadPath
          subject {
            path
            name
          }
        }
      }
    }
  }
}

curl Example

Use the following curl command to execute a query:

curl --location -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <token>" https://johnf.jfrog.io/onemodel/api/v1/graphql -d '{"query":"query { evidence { searchEvidence( first: 5, where: { hasSubjectWith: { repositoryKey: \"example-repo-local\" } } ) { totalCount } } }"}'