Skip to content

Fix improper syntax with spread operator #9441

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

Merged
merged 6 commits into from
May 20, 2022
Merged

Conversation

mongodben
Copy link
Contributor

currently the example shows incorrect JS syntax wherein an object is included within an object.

this change fixes by using the spread operator ....

it might be clearer to the user to not include deleteDog as a variable, but rather just put it directly into the mock results.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

currently the example shows incorrect JS syntax wherein an object is included within an object. 

this change fixes by using the spread operator `...`. 

it might be clearer to the user to not include `deleteDog` as a variable, but rather just put it directly into the mock results.
@apollo-cla
Copy link

@mongodben: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link
Contributor

@jpvajda jpvajda left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution, I'm going to confirm with @benjamn @brainkim @hwillson if this change should be merged.

@hwillson
Copy link
Member

Thanks for catching this @mongodben (and thanks for the ping @jpvajda). I have a feeling the intent here was to just use

{
  result: { data: deleteDog },
}

That might be the cleanest quick change, so we don't have people thinking the spread is necessary for some reason.

@jpvajda jpvajda self-assigned this May 12, 2022
@jpvajda jpvajda merged commit 297cfec into apollographql:main May 20, 2022
@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.

4 participants