Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to define a custom plugin using the FunctionNode? #967

Closed
QuentinJanuel opened this issue Apr 26, 2024 · 1 comment · Fixed by #972
Closed

How to define a custom plugin using the FunctionNode? #967

QuentinJanuel opened this issue Apr 26, 2024 · 1 comment · Fixed by #972
Labels
api Related to library's API bug Something isn't working

Comments

@QuentinJanuel
Copy link

Hello!

I was writing a custom plugin and needed to import among other nodes the FunctionNode but I realized it was not exported. Should it be exported or am I doing something unintended? I know all nodes are marked as internal, but I see no other way to define a custom plugin and the OperationNodeTransformer I use isn't marked as internal while still exposing the nodes so I'm not sure.

Thank you for the excellent project by the way!

@igalklebanov
Copy link
Member

igalklebanov commented Apr 27, 2024

Hey 👋

It appears we forgot to add it to the exports. I've opened a PR that takes care of that.

For now, you can still override transformFunction, and define FunctionNode type temporarily as follows:

export interface FunctionNode extends OperationNode {
  readonly kind: 'FunctionNode'
  readonly func: string
  readonly arguments: ReadonlyArray<OperationNode>
}

@igalklebanov igalklebanov added bug Something isn't working api Related to library's API labels Apr 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api Related to library's API bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants