Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous fragments directly inside named fragments aren't handled properly #4723

Open
rmosolgo opened this issue Dec 6, 2023 · 0 comments

Comments

@rmosolgo
Copy link
Owner

rmosolgo commented Dec 6, 2023

In this case, the fields aren't resolved and @defer doesn't set aside any work for later:

{
  things {
    ... ThingFields
  }
}

fragment ThingFields on Thing {
  ... @defer {
    name
  }
}

As a result, context[:deferrals] is nil and the fields are never resolved. I think it must be a bug in gather_selections.rb:

def gather_selections(owner_object, owner_type, selections, selections_to_run = nil, selections_by_name = {})

For reference, this query does work fine:

{
  ...QueryFields
}

fragment QueryFields on Query {
  things {
    ... @defer {
      name
    }
  }
}
@rmosolgo rmosolgo changed the title Anonymous fragments with directives immediately inside fragments aren't handled properly Anonymous fragments directly inside named fragments aren't handled properly Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant