Skip to content

GraphQL 3.x redirect loop #806

@duartegarin

Description

@duartegarin

Hi folks, I’m encountering a very strange behaviour with redirects and hoping someone can help me out.

Basically I have a piece of content which had the url changed and a redirect created. Thing is, when I have two “route” queries for some reason I seem to get a redirect loop.

For example:

fragment QueryGroupContentMeta on Query {
  __typename
  meta: route(path: $path) {
    __typename
  }
}


fragment QueryGroupContentMasthead on Query {
  __typename
  masthead: route(path: $path) {
    __typename
  }
}



query GroupContentContainer($path: String!) {

  ...QueryGroupContentMasthead
  ...QueryGroupContentMeta

}

This yields:

{
  "errors": [
    {
      "message": "Internal server error",
      "category": "internal",
      "locations": [
        {
          "line": 4,
          "column": 3
        }
      ],
      "path": [
        "meta"
      ]
    }
  ],
  "data": {
    "__typename": "Query",
    "masthead": {
      "__typename": "RedirectUrl"
    },
    "meta": null
  }
}

And in Drupal I can see Redirect loop identified at /group/2/career-planning/career-advice-for-law-students-in-new-zealand for redirect 2959

However if I remove any of those two fragments, I get no error.

Using 3.x version.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions