Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Sort group by field values #17690

Closed
universse opened this issue Sep 17, 2019 · 8 comments
Closed

Sort group by field values #17690

universse opened this issue Sep 17, 2019 · 8 comments
Labels
topic: GraphQL Related to Gatsby's GraphQL layer

Comments

@universse
Copy link
Contributor

I have a use case where I need to sort groups by fieldValue. Apparently there was a similar FR before #3684.

I can open a pull request too and will need some guidance.

@muescha
Copy link
Contributor

muescha commented Sep 18, 2019

Similar #7628

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Oct 11, 2019
@gatsbot
Copy link

gatsbot bot commented Oct 11, 2019

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! 💪💜

@universse universse added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Oct 12, 2019
@vladar
Copy link
Contributor

vladar commented Dec 25, 2019

@universse Isn't it a duplicate of #7628 ?

@universse
Copy link
Contributor Author

universse commented Dec 26, 2019

I think there's a difference.

For eg, using the following query,

allData(sort: { fields: date, order: DESC }) {
  group(field: category) {
    fieldValue
    nodes {
      id
    }
  }
}

I would want the ability to sort the group by fieldValue. So I would get some things like allData.group = [{ fieldValue: 'group1'}, { fieldValue: 'group2'}, { fieldValue: 'group3'}, ...] . It's not possible to do this currently. This is similar to #3684, which was closed.

As for #7628, I think what the OP meant is that the nodes within each group do not follow the sort order specified in the query, which is { field: data, order: DESC } in the above eg.

@Ir1d
Copy link

Ir1d commented Apr 20, 2020

Looking forward to this feature! We're currently sorting this outside graphql on our own.

@LekoArts LekoArts added topic: GraphQL Related to Gatsby's GraphQL layer and removed not stale labels Apr 20, 2020
@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 May 10, 2020
@universse universse removed the stale? Issue that may be closed soon due to the original author not responding any more. label May 10, 2020
@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 May 31, 2020
@universse universse added not stale and removed stale? Issue that may be closed soon due to the original author not responding any more. labels May 31, 2020
@abemedia
Copy link

Any updates on this? I have the same requirement. Right now I'm sorting in JS from the component but it would be great if this could be done in GraphQL.

@LekoArts LekoArts closed this as completed Mar 1, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Mar 1, 2021
@LekoArts LekoArts removed the not stale label May 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
topic: GraphQL Related to Gatsby's GraphQL layer
Projects
None yet
Development

No branches or pull requests

7 participants