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

Bug: Query Planner Fails for Nested Entity Fields Decorated With @requires #6004

Open
ryan01010111 opened this issue Sep 15, 2024 · 1 comment

Comments

@ryan01010111
Copy link

ryan01010111 commented Sep 15, 2024

Describe the bug

Note: This issue was first discovered in the query-planner package of the federation repo, and an issue has already been opened there.

When building a query plan for a query that selects fields with @requires conditions on a nested entity type, the router fails, resulting in error Cannot add selection of field \"X\" to selection set of parent type \"Y\". This issue is blocking us from migrating to Router.

To Reproduce

  1. Fork this CodeSandbox
  2. Start all services (if not already running) with:
npm run dev
  1. Run test query to reproduce the error with:
npm run test:query

Expected behavior

The query plan to be successfully built and executed.

Output

Router log:

{"timestamp":"2024-09-15T04:36:25.608204335Z","level":"WARN","message":"an error happened in the worker runtime Cannot add selection of field \"Book.id\" to selection set of parent type \"Book\"\n\n","target":"router_bridge::worker","resource":{"service.name":"unknown_service:router","service.version":"1.54.0","process.executable.name":"router"}}

Desktop (please complete the following information):

  • OS: Debian 12
  • Version: 1.54.0
@duckki
Copy link
Contributor

duckki commented Oct 29, 2024

Note that the new native query planner has the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants