Using Global Node ID's
You can get global node IDs of objects via app.arize.com and use them in GraphQL operations.
In Arize's GraphQL API, all nodes (entities) have a globally unique ID. This is a very powerful tool to quickly query and mutate parts of your account.
You can follow three steps to use global node IDs effectively:
- 1.Navigate to a
node
you would like to query in the app (e.x./spaces/:space_node_id
) - 2.Find the object's type in GraphQL.
- 3.Use the ID and type to do a direct node lookup in GraphQL.
Let's walk through an example.
You will notice your URL will contain a model node id like
/models/MDQ6VXNlcjU4MzIzMQ==
(Note you can always query for your models but this can sometimes be the easiest way to get started). The value after models/
is the model's globally unique node ID.In this example, the
node_id
value is MDQ6VXNlcjU4MzIzMQ==
. You can use this value to query the same object in GraphQL.You'll need to know the object's type first, though (even though we already sort of know it's a
Model
). You can check the type with a simple GraphQL query:query {
node(id: "MDQ6VXNlcjU4MzIzMQ==") {
__typename
}
}
This type of query — that is, finding the node by ID — is known as a "direct node lookup."
When you run this query, you'll see that the
__typename
is Model
Once you've confirmed the type, you can use an inline fragment to access the object by its ID and return additional data. In this example, we define the fields on
Model
that we'd like to query:query {
node(id: "MDQ6VXNlcjU4MzIzMQ==") {
... on Model {
modelType
}
}
}
This type of query is the standard approach for looking up an object by its global node ID.
You can now execute interesting queries about this node (a.k.a.
Model
) and make use of this ID in mutations (e.x. creating a performance monitor).Having trouble? Reach out to us via email [email protected] or Slack us in the #arize-support channel for more support.
Last modified 1yr ago