In this Knowledge Base article, we will discuss the reason behind the error(GRAPHQL_VALIDATION_FAILED) that occurs while executing GraphQL for one model.
However, before that, below is a quick introduction to what One Model GraphQL is:-
JFrog OneModel GraphQL API: Introduction and Usage
From Artifactory version 7.104 and above, the JFrog OneModel GraphQL API serves as the unified data layer for the entire JFrog Platform, allowing users to efficiently query data across multiple services (Artifactory, Xray, Distribution, etc.) using a single, powerful endpoint.
It is an evolution of the traditional REST APIs, offering precise data retrieval and reducing the number of requests needed.
Currently supported domains in the JFrog One Model GraphQL are Evidence and Release Lifecycle Management.
How to Use the API
- Endpoint: The API is exposed through a single URL endpoint, typically formatted as: https://<JFROG_PLATFORM_URL>/onemodel/api/v1/graphql
- Authentication: Access is secured using standard JFrog Access Tokens (JWTs) passed in the Authorization: Bearer <TOKEN> header.
- Example Query: To retrieve the creation date of a specific Release Bundle version:
query GetReleaseBundleDetails {
releaseBundleVersion {
getVersion(name: "my-app", version: "1.0.0", projectKey: "default") {
createdAt
}
}
}Note:
Ensure your Access Token has the necessary permissions (scopes) to query the data across the platform services you are targeting.
There can be scenarios where the above query, although it is correct, might fail with the GRAPHQL_VALIDATION_FAILED.
For ex:-
Request:-
curl -X POST -H "Authorization: Bearer <Access Token>" -H "Content-Type: application/json" \
http://JFROG_URL/onemodel/api/v1/graphql \
--data '{
"query": "query GetVersionDetails { releaseBundleVersion { getVersion(name: \"RBV2\", version: \"1.0\") { createdBy createdAt } } }"
}'
Output:-
{"errors":[{"message":"Cannot query field \"releaseBundleVersion\" on type \"Query\".","locations":[{"line":1,"column":27}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}]}%
This issue occurs if the onemodel and evidence are not enabled. Therefore, in order to use the /onemodel/api/v1/graphql endpoint, it's necessary to enable the onemodel and evidence services in the /opt/jfrog/artifactory/var/etc/system.yaml file. For example:
## ONEMODEL TEMPLATE
onemodel:
enabled: true
## EVIDENCE TEMPLATE
evidence:
enabled: true
Please see the system.yaml template for reference. It is necessary to restart Artifactory for the changes to take effect.
Once the changes are done, running the same API that failed above will be executed successfully.
Request:-
curl -X POST -H "Authorization: Bearer <Access Token>" -H "Content-Type: application/json" \
http://JFROG-URL/onemodel/api/v1/graphql \
--data '{
"query": "query GetVersionDetails { releaseBundleVersion { getVersion(name: \"RBV2\", version: \"1\") { createdBy createdAt } } }"
}'
Output:-
{"data":{"releaseBundleVersion":{"getVersion":{"createdBy":"admin","createdAt":"2025-09-29T17:47:14.961Z"}}}}%
For more information on GraphQL, please refer to the documentation below:-
- JFrog One Model GraphQL
- Use One Model GraphQL - examples