Use OneModel GraphQL

Use OneModel from the platform UI, the API, JFrog CLI, an AI client, or Ask AI. Select a method to get started.

Use OneModel via the UI

The best way to understand and interact with the OneModel API is by using the built-in GraphQL Playground.

The Playground is an interactive, in-browser graphical IDE that lets you explore the entire OneModel schema, write queries with auto-completion, and view responses in real time. Because the OneModel schema is self-documenting, the Playground is always your most accurate and up-to-date resource for field-level details, required arguments, and data types.

To use GraphQL Playground:

  1. Log in to the JFrog Platform UI
  2. In the Platform module, navigate to Integrations > GraphQL Playground
  3. In the query editor, type query { and press Enter to trigger the autocomplete function for fields and arguments.
    1. Click Documentation Explorer to browse queries, mutations, and types.
  4. Click Execute query to run the query and view the JSON response. The control shows a play icon.

Playground Controls

The GraphQL Playground includes these controls.

ControlDescription
Documentation ExplorerOpens the schema documentation. The search field filters the current page. Open a type to see its fields, arguments, and description. The back control, labeled Go back to followed by the previous type name, returns to that type.
HistoryOpens the queries you ran in this browser. For more information, see Playground History.
Re-fetch GraphQL schemaThe playground loads its schema when the page opens. This control keeps that schema.
Open short keys dialogOpens Short Keys, the list of keyboard shortcuts.
Open settings dialogOpens Settings. Clear data removes playground data stored in this browser, including query history and favorites.

The query editor includes these controls.

  • Execute query (Ctrl-Enter): Runs the query in the active tab. While the query runs, the control changes to Stop query (Ctrl-Enter). If the editor contains more than one operation and you haven't selected one, the control lists the operations.
  • Prettify query (Shift-Ctrl-P): Formats the query. It also formats Variables and Headers when they contain valid JSON.
  • Merge fragments into query (Shift-Ctrl-M): Copies fragment definitions into the operation.
  • Copy query (Shift-Ctrl-C): Copies the query to the clipboard.
  • Add tab: Opens another query tab. Close Tab appears on each tab when more than one tab is open.
  • Variables and Headers: Open those editors. Show editor tools opens both, and Hide editor tools closes them.

Playground History

History keeps the last 20 queries you run in this browser. A newer query replaces the oldest entry. The playground adds an entry when you run a valid GraphQL query. If you run the same query, variables, and headers as the newest entry, History doesn't change.

Favorites stay in this browser until you remove them, and you can save any number of them. Clear removes the history entries and leaves favorites in place.

A history entry includes these controls.

  • Set active: Loads that query, its variables, and its headers into the editor.
  • Edit label: Renames the entry. Save keeps the new name.
  • Add favorite: Saves the entry with your favorites. Remove favorite removes it from favorites.
  • Delete from history: Removes that entry.

Use OneModel via the API

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

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

JFrog OneModel GraphQL currently supports the POST with JSON format. For more information, see Error Handling.

To use the OneModel endpoint, execute your query using cURL or an API client application such as Postman. For the full endpoint specification, see Query the OneModel Supergraph.

Endpoint and Request Shape

The following table explains the endpoint and request details for issuing OneModel GraphQL queries.

AspectValue
MethodPOST
Path/onemodel/api/v1/graphql
Content-Typeapplication/json
Body{ "query": "...", "variables": { ... } }
AuthenticationStandard JFrog Platform authentication (access token or basic authentication). Resource access is enforced per query.

Usage Examples

Query Example

Use the following query to get the first five 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 an API request:

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

Use OneModel via the CLI

Run a OneModel GraphQL query with JFrog CLI. Send a POST request to the OneModel endpoint and pass the query in the request body. For the full procedure, see Run a GraphQL Query via OneModel.

jf api /onemodel/api/v1/graphql \
  -X POST \
  --input ./graphql-query.json \
  -H "Content-Type: application/json"

Use OneModel via the MCP Server

You can use the JFrog MCP Server tools to build and execute queries. The OneModel tools are in Beta, and require signing the MCP Beta agreement. For more information, see OneModel tools.

Use OneModel via Ask AI

📘

Note

Data coverage for this Beta release is still expanding, so some data in the JFrog Platform may not be available yet. Behavior may change before general availability.

You can ask questions about data in your JFrog Platform from Ask AI, in your own words. Ask AI uses JFrog OneModel GraphQL to query the environment you're signed in to, and answers from the results. You can query OneModel in natural language, with no GraphQL or schema knowledge required. The agent is read-only.

How It Works

  1. Ask a question: Describe the data you want in your own words.
  2. Explore the schema: The agent finds the relevant types and fields in the OneModel schema.
  3. Agent builds and runs the query: The agent builds a GraphQL query and runs it against the OneModel endpoint.
  4. Get the answer: You receive the result in natural language, along with the GraphQL query that produced it.

For more information, see JFrog AI Assistant.


Did this page help you?