Putting global node IDs to use
You can follow three steps to use global node IDs effectively:-
Navigate to a
nodeyou would like to query in the app (e.x./spaces/:space_node_id) - Find the object’s type in GraphQL.
- Use the ID and type to do a direct node lookup in GraphQL.
1. Navigate to a model
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.
2. Finding the object type in GraphQL
In this example, thenode_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:
__typename is Model
3. Do a direct node lookup in GraphQL
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 onModel that we’d like to query:
Model) and make use of this ID in mutations (e.x. creating a performance monitor).
Having trouble? Reach out to us via email support@arize.com or Slack us in the #arize-support channel for more support.