0

I have this:

type Client @guard {
  id: ID!
  name: String!
  phone: String
  orders: [Order!]! @hasMany # How do i make it possible to order this array via client side?
}
extend type Query {
  client (
    id: ID! @eq
  ): Client @find
}

I would like to do something like that:

{
  client (id: 10) {
    orders (orderBy: ....) {
    }
  }
}

I already tried to add @orderBy on orders field but it doesn't seems to work, is it possible to do in lighthouse-php?

João Hamerski
  • 461
  • 1
  • 5
  • 22

1 Answers1

-1

@orderBy directive let you specify a relation you can order your query from. See the documentation

gizon_dev
  • 36
  • 1
  • 5
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 07 '22 at 13:48
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31231694) – tomerpacific Mar 12 '22 at 16:21