Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Support for recursive relationships #79

Open
andlien opened this issue May 27, 2019 · 1 comment
Open

Support for recursive relationships #79

andlien opened this issue May 27, 2019 · 1 comment
Labels
feature request New feature request

Comments

@andlien
Copy link

andlien commented May 27, 2019

Hi! Thank you for developing this client!

Is there any way to use nodes with recursive relationships? For instance, is it possible to generate the following query

{
  query {
    cars(id: 1) {
      id
      owner {
        cars {
          id
        }
      }
    }
  }
}

to list all cars owned by the owner of this car?

Currently the query-generation results in a stack overflow

@andlien andlien changed the title Support for bi-directional relationships Support for recursive relationships May 27, 2019
@chemdrew
Copy link
Contributor

Hi Anders,

Right now no, there is no break when recursively generating the query.

I think the cleanest approach to adding this feature would be to add a new annotation to support something like @GraphQLRecursive(depth = 1).

Then in the recursive getChildren() in GraphQLRequestEntity method on line 240 adding a depth parameter with a sane default to break out of

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants