# Check and composition for multiple subgraphs depending on each other on type

**URL:** <https://community.apollographql.com/t/check-and-composition-for-multiple-subgraphs-depending-on-each-other-on-type/8631>\
**Category:** GraphOS\
**Tags:** federation, rover, graphos, schema-checks, schema-proposals\
**Created:** [February 26, 2025, 11:21am UTC](https://community.apollographql.com/t/check-and-composition-for-multiple-subgraphs-depending-on-each-other-on-type/8631 "2025-02-26T11:21:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juancarlosjr97](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/juancarlosjr97/32/1517_2.png) [@juancarlosjr97](https://community.apollographql.com/u/juancarlosjr97)\
**Post date:** [February 26, 2025, 11:21am UTC](https://community.apollographql.com/t/check-and-composition-for-multiple-subgraphs-depending-on-each-other-on-type/8631/1 "2025-02-26T11:21:03Z")

</div>

I have a scenario of 3 subgraphs that share a type.

The type is defined as `Article` and is used by three different subgraphs. Now, the issue is that I need to add a new @key, I raised a proposal and the proposal is passing successfully. The issue is when running the scheme check for each subgraph independently, it fails as they depend on each other.

They all fail to check or publish, and composition fails as they depend on each other.

I tried `rover subgraph publish` and `rover subgraph check` but does not allow multiple subgraphs.

---

<div class="post-metadata">

**Author:** ![juancarlosjr97](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/juancarlosjr97/32/1517_2.png) [@juancarlosjr97](https://community.apollographql.com/u/juancarlosjr97)\
**Post date:** [February 26, 2025, 3:35pm UTC](https://community.apollographql.com/t/check-and-composition-for-multiple-subgraphs-depending-on-each-other-on-type/8631/2 "2025-02-26T15:35:57Z")

</div>

So, a solution that allowed us to have a successful composition was to add a second `@key` directive that would not cause a composition error and then a second set of changes that would remove the key directive with the incomplete list.

This composition does not fail during the check or publish of any subgraph.

```auto
type Article
  @key(fields: "fieldX fieldY fieldD")
  @key(fields: "fieldX fieldY fieldD newFieldKey") 

```

and then to

```auto
type Article
  @key(fields: "fieldX fieldY fieldD newFieldKey") 

```

@
