Standardize groupBy and other concepts

What’s your idea?

There are some standards/conventions in GraphQL such as filter and orderBy, but 8base provides other such as groupBy. It would be nice if others followed these conventions.

What problem might it solve?

What’s great about GraphQL? – It’s extremely flexible. What’s not great about GraphQL? – It’s extremely flexible. Having a de-facto SQL-ish GraphQL syntax would make it easier to support other platforms and much easier to earn vs every provider creating their own syntax.

Any ideas on how you think it could/should work?

As proposals to GraphQL community, providing lots and lots of examples.

We’re definitely playing on the fringes of GraphQL with our implementation of GroupBy. That said, happy to review how you think it could be improved.

I think this breaks the GraphQL spec. If you have regular aggregations, do you actually need GroupBy?

A Graph resolves differently than a regular database…

J

Hey @jdgamble555 - yeah I agree that we definitely stepped out of the GraphQL spec when it comes to our implementation of the GroupBy argument. That said, we wanted to make it a bit more flexible than what would be enabled by exposing simple/common aggregation methods (sum, avg, etc) on a field type. That said, open to feedback on where you think we could improve our API design in this domain.

Can you sort by aggregation?

query {
  postsList(sort: {
      votes: {
        count: DESC
      }
    }
  ) {
    items {
      title
      createdAt
      author {
        name
      }
    }
  }
}

This seems like the most logical way to me for MOST cases (if you could sort sub-queries, top level by subqueries, etc).

Although I can appreciate more flexibility.

J