Links

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 an base64url encoded string with format of <NODE_TYPE>:<ID>.

Generate the user node id example

Go
Python
package main
import (
"encoding/base64"
"fmt"
)
func main() {
nodeID := base64.RawURLEncoding.EncodeToString([]byte("User:97b1c929-842c-415c-a7df-6967efdda160"))
fmt.Println(nodeID)
}
import base64
base64.urlsafe_b64encode(b'User:97b1c929-842c-415c-a7df-6967efdda160').replace(b'=', b'')

Fetch the user object example

The query:
query ($userID: ID!) {
node(id: $userID) {
... on User {
id
standardAttributes
}
}
}
The variables:
{
"userID": "<BASE64URL_ENCODED_USER_NODE_ID>"
}