为什么GitHub Graphql和Yelp Graphql不';不允许多个orderBy字段?

为什么GitHub Graphql和Yelp Graphql不';不允许多个orderBy字段?,graphql,Graphql,为什么GitHub Graphql和Yelp Graphql不允许多个orderBy字段 现在 我想这样提问 repositories(first:3, orderBy: [{field: COMMENT, direction: DESC}, {field: CREATED_AT, direction: DESC}]) { edges { node { id name } } } 仅仅是因为他们的GraphQL API不支持GraphQL SDL

为什么GitHub Graphql和Yelp Graphql不允许多个orderBy字段

现在

我想这样提问

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

仅仅是因为他们的GraphQL API不支持GraphQL SDL中的定义。您可以尝试以下方法:

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