Using global node IDs

The node id is a globally unique identifier of an object. It is needed when you call the GraphQL query and mutation. In this section, we will go through how to generate the node ID for calling the Admin GraphQL API.

The node id is a base64url encoded string with the format of <NODE_TYPE>:<ID>. For example, in User:97b1c929-842c-415c-a7df-6967efdda160 , the node is "User" while "97b1c929-842c-415c-a7df-6967efdda160" is the ID for a specific user.

1. Generate id for User node type

You can use your preferred programming language or tool to encode node IDs to base64url as shown below:

package main

import (
	"encoding/base64"
	"fmt"
)

func main() {
	nodeID := base64.RawURLEncoding.EncodeToString([]byte("User:97b1c929-842c-415c-a7df-6967efdda160"))
	fmt.Println(nodeID)
}

Fetch the User object example

The query:

2. Generate id for AuditLog node type

Fetch AuditLog object example

Query:

3. Generate id for Session node type

Fetch Session object example

Query:

4. Generate id for Authenticator node type

Fetch Authenticator object example

Query:

5. Generate id for Authorization node type

Fetch Authorization object example

Query:

6. Generate id for Identity node type

Fetch Identity object example

Query:

Last updated

Was this helpful?