Skip to content

Custom Client Directive Example? #1179

@ryanscherler

Description

@ryanscherler

Is there documentation that outlines how to create a custom client directive. All I can find is the brief information such a directive here: https://lighthouse-php.com/4.8/digging-deeper/client-directives.html#client-directives - but cannot understand how to implement a custom one. The idea is to create a client side directive to transform an asset. E.g.

{
  me {
    name
    avatar @transform(size: 200)
  }
}

I tried to create a directive called TransformDirective and resolve it, but get the error "Unknown directive \"transform\".",

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsConcerns the documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions