wundergraph / cosmo

The open-source solution to building, maintaining, and collaborating on GraphQL Federation at Scale. The alternative to Apollo Studio and GraphOS.
https://cosmo-docs.wundergraph.com/
Apache License 2.0
599 stars 81 forks source link

Composition of Root type field returning Root type fails #891

Open maxrad82 opened 1 week ago

maxrad82 commented 1 week ago

Component(s)

composition

Component version

latest

wgc version

0.57.7

controlplane version

latest

router version

latest

What happened?

Hi,

when trying to compose 2 subgraphs:

subgraph #1

type Mutation { impersonate(...): Mutation }

subgraph #2

type Book { id: ID! }

type Mutation { upsertBook(..): Book }

The composition fails complaining that we should either transform the Mutation type to an Entity with an @key field or declaring @shareable impersonate in the 2 subgraphs (we can't do this)

I assume that it is a issue related to Root types, the composition succeeds in Apollo graph os

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Package Manager: pnpm, npm, yarn, etc Compiler(if manually compiled): (e.g., "go 14.2")

Router configuration

No response

Router execution config

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 1 week ago

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

Aenimus commented 1 week ago

Hi @maxrad82,

Please could you create a PR with a minimal failing test in the composition tests? The best place would be here: https://github.com/wundergraph/cosmo/blob/main/composition/tests/resolvability.test.ts

Thanks,

The WunderGraph Team

maxrad82 commented 1 week ago

Sure, in which branch should i create the PR ?

Aenimus commented 1 week ago

Hi @maxrad82,

You'll have to fork the Cosmo repository, then a new branch with a name relevant to the issue would be great.

Thanks!

maxrad82 commented 1 week ago

The corresponding PR: #893

Aenimus commented 1 week ago

Hi @maxrad82,

Thank you; it's appreciated! We'll investigate in due course.