mercurius-js / mercurius-gateway

Mercurius federation support plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Federation: query for external entity not working

pkeeley opened this issue · comments

I have attached a small project with two files, apollo.js and mercurius.js. Both set up a small federation. Running this query against Apollo returns the expected results, mercurius does not. Mercurius also makes extra calls (which is why it is not returning the correct results).

Mercurius makes the following calls:

  • Query.userByPost
  • User.posts
  • Posts already there
  • User.posts
  • Posts already there
  • 2 x User.__resolveReference
  • 2 x User.posts

Apollo makes these:

  • Query.userByPost
  • User.posts
  • Posts already there
  • User.posts
  • Posts already there

Apollo doesn't resolve the reference or call User.posts the third and forth time.

query { userByPost(ids: ["u1","u2"]) { id posts { pid title content } } }
Archive.zip