Skip to content

Documentation on adding custom directives #446

Closed
@JakeAngell

Description

@JakeAngell

I'm looking to create a custom directive for my GraphQL server. I want my server to omit certain fields conditionally, based on the value of the fields that are decorated with the directive.

For example:

{
  allSites {
    siteId @overN(n:4)
    siteName
  }
}

Would return all sites and their names, but only include their siteId if its value is over 4.

Is there any documentation or an API I could read so I can see the best practice when adding a new directive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions