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

Add description attribute to annotations to override PHPDoc #453

Open
oojacoboo opened this issue Apr 2, 2022 · 2 comments
Open

Add description attribute to annotations to override PHPDoc #453

oojacoboo opened this issue Apr 2, 2022 · 2 comments

Comments

@oojacoboo
Copy link
Collaborator

Currently, the PHPDoc comment is exposed over the schema as the description. This is fine to remain. However, often there are times where internals are needed in the PHPDoc. In fact, I'd argue that the PHPDoc should really be reserved for internal documentation only. It's too easy to accidentally expose something undesired in the PHPDoc. Additionally, there isn't any way to add additional internal documentation in the PHPDoc without having it also added to the GraphQL schema.

Therefore, with the addition of a new param description on annotations, we can override whatever description is in the PHPDoc. This would maintain BC and simplicity for others, but provide a finer grained option for other cases.

@oojacoboo
Copy link
Collaborator Author

oojacoboo commented Apr 9, 2022

It's worth mentioning that a description attribute is currently supported by some annotations. It's needed on the following:

  • Query
  • Mutation
  • Type
  • ExtendType
  • Factory

@oojacoboo oojacoboo changed the title Add description param to annotations to override PHPDoc Add description attribute to annotations to override PHPDoc Apr 9, 2022
@Lappihuan
Copy link
Contributor

I'd consider implementing a DescriptionFieldMiddleware using the existing FieldMiddlewares as described in #439 (comment) by @withinboredom since it would be possible to have the new Annotation not ever trying to read PHPDoc and the current system side by side and deprecate the description attribute on all other Annotations for a later release.

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

No branches or pull requests

2 participants