technuma
technuma

Reputation: 303

Why GitHub Graphql and Yelp GraphQL don't allow multiple orderBy field?

Why GitHub Graphql and Yelp GraphQL don't allow multiple orderBy field?

Now

repositories(first:3, orderBy: {field: CREATED_AT, direction: DESC}) {
  edges {
    node {
      id
      name
    }
  }
}

I want to query like this.

repositories(first:3, orderBy: [{field: COMMENT, direction: DESC}, {field: CREATED_AT, direction: DESC}]) {
  edges {
    node {
      id
      name
    }
  }
}

Upvotes: 1

Views: 105

Answers (2)

Ken Cloud
Ken Cloud

Reputation: 933

You can try this:

orderBy: {fields: [COMMENT, CREATED_AT], order: [ASC, DESC]}

Upvotes: 0

xwlee
xwlee

Reputation: 1099

Simply because of their GraphQL API doesn't support this as per define in their GraphQL SDL.

Upvotes: 1

Related Questions