Hacker News new | ask | show | jobs
by santialbo 3908 days ago
and you'll end up with an endpoint that can potentially bomb your datastore

    query User {
      friends {
        friends {
          friends {
            ...
          }
        }
      }
    }
how do you prevent something like this happening on graphQL backed with a series of resolves that query a SQL database?
1 comments

Limit recursion with a max depth parameter (sangria)
I don't need that many levels to make it explode and you probably don't want to set a very low max depth since it beats the purpose of graphql itself.