<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnimationGraphResource/validate(definition:nodeResourceMapping:skeletonResource:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation22AnimationGraphResourceC8validate10definition04nodeE7Mapping08skeletonE0SaySSG0B04DataV_SDySiAA0cE0CGAA08SkeletonE0CtFZ"
  },
  "title" : "validate(definition:nodeResourceMapping:skeletonResource:)"
}
-->

# validate(definition:nodeResourceMapping:skeletonResource:)

Compiles an animation graph definition and returns any diagnostic messages the
compiler produced, without producing a resource.

```
static func validate(definition: Data, nodeResourceMapping: [Int : AnimationResource] = [:], skeletonResource: SkeletonResource) -> [String]
```

## Parameters

`definition`

The animation graph definition to validate.

`nodeResourceMapping`

A mapping from graph-node IDs to the
[`AnimationResource`](/documentation/RealityKit/AnimationResource) clips those nodes reference. Defaults to empty.

`skeletonResource`

The [`SkeletonResource`](/documentation/RealityKit/SkeletonResource) the graph targets.

## Return Value

An array of diagnostic messages produced by the compiler. An empty array
indicates the definition compiled cleanly.

## Discussion

Call this method to validate a definition at editor time without paying the cost of
holding on to the compiled resource and without having to handle a thrown error. To
produce a usable [`AnimationGraphResource`](/documentation/RealityKit/AnimationGraphResource), call
[`init(definition:nodeResourceMapping:skeletonResource:)`](/documentation/RealityKit/AnimationGraphResource/init(definition:nodeResourceMapping:skeletonResource:)) instead.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)