Skip to content

Document resolvers on extra arguments - #194

Merged
lorisleiva merged 1 commit into
mainfrom
document-resolvers-on-extra-arguments
Oct 5, 2026
Merged

lorisleiva merged 1 commit into
mainfrom
document-resolvers-on-extra-arguments

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR documents how to resolve the default of an extra argument with custom code. A codama.resolver plugin on a codama.extraArgument plugin node describes how renderers resolve that extra argument's default, as it would on a struct field.

pluginNode('codama.extraArgument', {
    payload: { identifier: 'tokenStandard', type: definedTypeLinkNode('tokenStandard') },
    plugins: [pluginNode('codama.resolver', { payload: { name: 'resolveTokenStandard', dependsOn: ['accounts.mint'] } })],
});

Upgrading a v1 IDL produces this shape when an extra argument's default is a resolver, or otherwise can't be expressed in v2, so that no resolver is lost in the upgrade.

@lorisleiva
lorisleiva marked this pull request as ready for review October 5, 2026 14:19
@lorisleiva
lorisleiva merged commit b342935 into main Oct 5, 2026
1 check passed
@lorisleiva
lorisleiva deleted the document-resolvers-on-extra-arguments branch October 5, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant