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

Refactor (www): Use nodes in gatsbyjs.org code instead of edges.node #21255

Closed
tesseralis opened this issue Feb 7, 2020 · 4 comments
Closed
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@tesseralis
Copy link
Contributor

Summary

Since Gatsby v2.2.0, it's been possible to use nodes instead of edges.node in GraphQL queries. All instances of:

query {
  someNodes {
    edges {
      node {
        <fields>
      }
    }
}

can be replaced with:

query {
  someNode {
    nodes {
      <fields>
    }
  }
}

The code that iterates over these can also change from

someNode.edges.forEach({ node }) => {
 doSomething(node)
})

to:

someNode.nodes.forEach(node => {
  doSomething(node)
})

Motivation

Code cleanliness of the gatsby website. Using up-to-date examples in our codebase can help guide people in showing good patterns, even if our docs can't update those examples due to back-compat issues.

@tesseralis tesseralis added help wanted Issue with a clear description that the community can help with. 💡 Proposed Work labels Feb 7, 2020
@b0nbon1
Copy link
Contributor

b0nbon1 commented Feb 9, 2020

@tesseralis Awesome, interested in contributing I'd like to grab it.

@tesseralis
Copy link
Contributor Author

@b0nbon1 sure, go ahead!

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 19, 2020
@github-actions
Copy link

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants