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

query data sorting and filtering #288

Closed
1 of 5 tasks
thescientist13 opened this issue Feb 17, 2020 · 2 comments
Closed
1 of 5 tasks

query data sorting and filtering #288

thescientist13 opened this issue Feb 17, 2020 · 2 comments
Assignees
Labels
Content as Data documentation Greenwood specific docs feature New feature or request

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Coming out of discussions in meeting and #271 and #285 , it seems like the topic of sorting and filter in GraphQL (like for solving the issue of the shelf's sub nav) should be moved to its own issue.

Details

There are a couple options under consideration for achieving this

Queries

The enhancement here would be to allow users to request the order of results instead of having to do it themselves (somewhat negating the value of querying for the data in the first place).

Declarative

One option is to be able to do something like this

query {
  navigation{
    label,
      'page-a',
      'page-c',
      'page-b'
    link
  }
}
Params

Another way would be to have it done through the client / GraphQL

async connectedCallback() {
  super.connectedCallback();

  const response = await client.query({
    query: NavigationQuery,
    variables: {
      sort: [
         label: [
           'page-a',
           'page-d',
           'page-b'
         ]
      }
  });

  this.navigation = response.data.navigation;
}

Front Matter

The front matter approach would be similar to what is being requested in #274 , in that menu configuration could be added as front matter, e.g.

---
label: 'features'
menu: side
title: 'Features'
index: 2

And then queried.

But also like in #274, this would require everything to be 100% percent transparent. In #285, one issue is that the specific logic to the user (e.g. menu) is too specific to the implementation of the Greenwood website, and not really useful or should be hardcoded into any public to users (e.g resolvers, queries, etc).

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs Content as Data labels Feb 17, 2020
@thescientist13 thescientist13 added this to the MVP milestone Feb 17, 2020
@thescientist13 thescientist13 mentioned this issue Feb 22, 2020
13 tasks
@hutchgrant
Copy link
Member

hutchgrant commented Mar 3, 2020

In #285, one issue is that the specific logic to the user (e.g. menu) is too specific to the implementation of the Greenwood website

I disagree, the logic is for any menu, on any website, and could be utilised for footers, side menus, or navigation. The example from that PR is using greenwood website, but nothing in the logic is specific to greenwood website. Menu is just one query example. This is further explained in #291

@thescientist13 thescientist13 removed their assignment Apr 19, 2020
@thescientist13 thescientist13 added feature New feature or request and removed enhancement Improve something existing (e.g. no docs, new APIs, etc) labels Feb 9, 2022
@thescientist13
Copy link
Member Author

I think this may beyond our scope or that of GraphQL, but if anyone comes looking for this and has a need, please feel free to reopen. 😃

@thescientist13 thescientist13 removed this from the 1.0 milestone Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content as Data documentation Greenwood specific docs feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants