-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Document private functions with @internal tag #2205
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
Document private functions with @internal tag #2205
Conversation
74da857 to
27b8641
Compare
|
I can confirm the same values locally. I just did not add internal flags to |
src/__tests__/starWarsData.js
Outdated
| /** | ||
| * Allows us to query for a character's friends. | ||
| * | ||
| * @internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@craicoverflow Thanks a lot for PR 👍
One I didn't mention is that __tests__ & __fitures__ are not part of NPM package so all function exported from these folders are private by definition.
So can you please revert all changes under __tests__ folder?
src/jsutils/Path.js
Outdated
| /** | ||
| * Given a Path and a key, return a new Path containing the new key. | ||
| * | ||
| * @internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for jsutils folder:
https://github.com/graphql/graphql-js/blob/master/src/jsutils/README.md
These functions are not part of the module interface and are subject to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can change that 👍
It's maybe worth noting that in this same file, pathToArray is exported as public in src/index.js (aliased as responsePathAsArray).
Line 287 in 83d5011
| responsePathAsArray, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@craicoverflow Good catch 👍 I need to think about it 🤔 💭
20c91a7 to
1f835bb
Compare
1f835bb to
88b4aa8
Compare
Closes #2183
Manually added an
@internalJSDoc tag to exported functions that are not part of the public API.I began by by making an ESLint rule which lives in the
resourcesdirectory.Although this helped me to identify the exported functions which are not exported in
src/index.js, the rule is not yet stable enough to be included and I may look to follow this up with a separate PR, dealing exclusively with the ESLint rule.