# Federation only working one way

**URL:** <https://community.apollographql.com/t/federation-only-working-one-way/6252>\
**Category:** Schema Design\
**Tags:** federation, router\
**Created:** [May 12, 2023, 6:45am UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252 "2023-05-12T06:45:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thknupf](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@thknupf](https://community.apollographql.com/u/thknupf)\
**Post date:** [May 12, 2023, 6:45am UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252/1 "2023-05-12T06:45:53Z")

</div>

Hello everyone,  
I have a strange problem with federation. It works only in one direction. We have the same problem with multiple services. Below a shortend version of the graphql files.

**The gate2User returns null because the user service is not called at all.**

We are using apollo rover the generate the supergraph.  
Apollo router as a federation gateway.  
And netflix dgs as service implementation.

working query:

```auto
{
	user {
            shortName
            gate2Cs {
                id
                number
            }
    }
}

```

NOT working query:

```auto
{
	c(id) {
            id
            number
            gate2UserId
            gate2User {
                shortName
            }
	}
}

```

The problem is that the user-service is not called at all when using the not working query and so the resulting value of gate2User is null.  
The rest of the values are returned.

graphql service c:

```auto
type Query {
    c(id: String, language: String = "en"): C
}

type C @key(fields: "id") {
    id: ID!
    number: String
    gate2UserId: String
    gate2User: User
}

type User @key(fields: "id") @extends {
    id: ID! @external
    shortName: String @external
    gate2C: [C!]! @requires (fields: "shortName")
}

```

service user:

```auto
type Query {
    user(id: String): User
}

type User @key(fields: "id") {
    id: ID!
    shortName: String
    name: String
}

type C @key(fields: "id") @extends {
    id: ID! @external
    gate2UserId: String @external
    gate2User: User @requires (fields: "gate2UserId")
}

```

supergraph-config:

```auto
federation_version: =2.3.1
subgraphs:
  service-c-v3:
    routing_url: http://service-c-v3/graphql
    schema:
      file: ./subgraphs/service-c-v3.graphql
  service-user-v3:
    routing_url: http://service-user-v3/graphql
    schema:
      file: ./subgraphs/service-user-v3.graphql

```

router config:

```auto
supergraph:
  listen: 0.0.0.0:8085
  introspection: true
include_subgraph_errors:
  all: true
headers:
  all:
    request:
      - propagate:
          named: "Authorization"
      - propagate:
          named: "<censored>"
override_subgraph_url:
    service-c-v3: http://localhost:8080/c/v3/graphql
    service-user-v3: http://localhost:8082/user/v3/graphql

```

---

<div class="post-metadata">

**Author:** ![dkuc](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/dkuc/32/2892_2.png) [@dkuc](https://community.apollographql.com/u/dkuc)\
**Post date:** [May 12, 2023, 6:01pm UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252/2 "2023-05-12T18:01:02Z")

</div>

Hello 👋  
Without actual code that reproduces the issue I cannot say for sure but your schema is somewhat confusing and I don’t think is correct, i.e.

- within service `c` you define `C.gate2User: User` field which would imply this field is to be resolved locally
- within service `user` you define the same field that is added as a new functionality to the `C` type

What is the expected behavior? Since you have `user` service, I’d assume that is the owner of the `User` type and subject matter expert on how to resolve user information → i.e. the `gate2User` field defined in the `user` is the one you want and the duplicate field definition from service `c` should be removed.

Thanks,  
Derek

---

<div class="post-metadata">

**Author:** ![thknupf](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@thknupf](https://community.apollographql.com/u/thknupf)\
**Post date:** [May 15, 2023, 5:35am UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252/3 "2023-05-15T05:35:46Z")

</div>

Hello dkuc,  
yes you are correct.  
That is a copy&paste error when I prepared the version for this post:  
please ignore: within service `c` you define `C.gate2User: User` field which would imply this field is to be resolved locally  
Please ignore that.

---

<div class="post-metadata">

**Author:** ![thknupf](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@thknupf](https://community.apollographql.com/u/thknupf)\
**Post date:** [May 17, 2023, 8:10am UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252/4 "2023-05-17T08:10:56Z")

</div>

please close this ticket. I found the problem on my end

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/federation-only-working-one-way/6252/5 "2025-02-06T20:48:58Z")

</div>


