Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[WIP] Support adding directives as docblock tags #167

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

captbaritone
Copy link
Owner

This is a diff exploring adding the ability to attach directives to different constructs. I works by interpreting docblock tags (which look like directives!) as directives.

A tag is interpreted as a directive if:

  1. It has no value, and is a defined directive in the schema
  2. It is written with arguments: @someDirective(someArg: "foo")

This is very light weight and intuitive (I think) since it does not require any novel tag name or syntax for attaching directives. However, it comes at the cost of some ambiguity. This could be especially problematic if there is a namespace collision between TypeScript tag names and directive names in your schema.

Note that this PR does not (yet?) include the ability to define directives, so it hasn't yet been tested end to end.

Todo

  • Add ability to define directives
  • Add tests for each position where we expect/accept directives

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for grats ready!

Name Link
🔨 Latest commit c6ab6f8
🔍 Latest deploy log https://app.netlify.com/sites/grats/deploys/6788b9c8fa7427000813f605
😎 Deploy Preview https://deploy-preview-167--grats.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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