0

I Have a query like this

`
query {
  doctors @rest(type: "doctors", path: "/doctors/") {
      Result {
          Id
          FirstName
          LastName
          Items (limit: 10) {
             id
             title
          }
      }
}
`

I want to get only 10 items from the Items, but I get the full list!

Is This doable or not?

Thank you.

DAMAR225
  • 1,993
  • 1
  • 13
  • 22
  • Question: does the rest endpoint return an array there, or are you doing something special to fetch this nested property, like a `typePatcher`? – Dan Crews Feb 20 '23 at 18:36
  • @DanCrews Yes the rest endpoint return an array there. – DAMAR225 Feb 21 '23 at 11:43
  • 1
    OK. So GraphQL arguments don't mean anything until they're implemented. The only way I know of for you to make up arguments out of thin air like this would be for you to implement a `typePatcher` that parses the AST in `context.resolverParams.info` and pulls out the arguments you're passing in. If you do this, you're still going to get all of the results back from the endpoint, so I'm not sure it's worth you trying to do this, rather than just handling it in your own code. – Dan Crews Feb 21 '23 at 18:13

0 Answers0