GraphQL Plugins
Plug in a external package to arweavekit/graphql
The use
function exposed via the ArweaveKit object from arweavekit/graphql
package allows you to plugin external packages into arweave kit package.
Basic Syntax
The function is called as follows:
import * as externalPackage from 'externalPackage';
import { ArweaveKit } from 'arweavekit/graphql';
const arweaveKit = ArweaveKit.use({ name: 'MyPlugIn', plugin: externalPackage });
console.log(arweavekit.functionFromExternalPackage())
Create a Plugin
Most existing packages in Arweave will already be supported without any additional work, the functions just need to be defined and exported in the external package:
import * as ExternalPackage from 'package'
export function PackagePlugIn() {
return ExternalPackage
}
Last updated
Was this helpful?