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

Let addTypenameToDocument take any ASTNode (including DocumentNode, as before) #9595

Merged
merged 2 commits into from
Apr 11, 2022

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Apr 11, 2022

As requested by @AnthonyMDev.

@AnthonyMDev
Copy link

Thank you! That's perfect!

@benjamn benjamn merged commit a8fb387 into release-3.6 Apr 11, 2022
@benjamn benjamn deleted the let-addTypenameToDocument-take-any-ASTNode branch April 11, 2022 20:19
export const addTypenameToDocument = Object.assign(function (
doc: DocumentNode
): DocumentNode {
return visit(checkDocument(doc), {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth checking that doc.kind is a string, to protect against passing in strings by accident? Or is it unlikely that anyone is going to be passing a string into this function from JS.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants