Circular references in fragments


#1

It seems that requests with circular references in fragments fail abruptly, instead of returning a validation error. See the “No fragment cycles” validation rule.


#2

Hiya! Would you mind posting a query that demonstrates this?


#3

Sure, here’s an example:

{
  repositoryOwner(login:"apollostack"){
    ... on User {
      ...f1
    }
  }
}

fragment f1 on User {
  followers(first: 10){
    edges {
      node {
        ... f1
      }
    }
  }
}

GraphiQL will highlight the error, but the query is still runnable and returns HTML that contains the following string: “Something, somewhere, has gone horribly, horribly wrong.”


#4

Oh dang. I’ve logged an internal issue for this. Thanks!


#5

…and by “internal issue” I of course mean “an issue in the open source gem:laughing:.


#6

Thanks! This is now fixed!


#7