Hooks
Deploy the Grafbase Gateway together with the WASM file that contains the code for your custom hooks.
[hooks]
location = "path/to/custom.component.wasm"
networking = false
stdout = false
stderr = false
environment_variables = false
max_pool_size = 1000locationspecifies the path to the WASM file that contains custom hooks. You must provide a valid path and have read access to the file.networkingenables network access with TCP and UDP sockets, name resolution and WASI HTTP bindings to the guest. TCP and UDP sockets work only if the guest language supports WASI preview 2 standard. Default value is false.stdoutenables the guest to write to the standard output stream. Default value isfalse.stderrenables the guest to write to the standard error stream. Default value isfalse.environment_variablescopies host environment variables to the guest. Default value isfalse.max_pool_sizespecifies the number of hook instances that can run concurrently. Default value is four times the number of CPU cores.
Define one or more pre-opened directories to enable file system access for guests:
[[hooks.preopened_directories]]
host_path = "/path/in/host/filesystem"
guest_path = "/path/in/guest/filesystem"
read_permission = true
write_permission = truehost_pathspecifies an existing directory in the host filesystem. Give the user executing the Grafbase Gateway binary access to this directory.guest_pathdefines the path visible in the guest. Set this virtual path to any value. The guest uses this path to access the filesystem.read_permissionallows reading all files and directories from the specifiedhost_path.write_permissionallows creating and modifying files and directories in the specifiedhost_path.