Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

shared schemas with @external/@extends dont work #22

Open
HashDot opened this issue Mar 30, 2021 · 5 comments
Open

shared schemas with @external/@extends dont work #22

HashDot opened this issue Mar 30, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@HashDot
Copy link

HashDot commented Mar 30, 2021

Hi, first of all thanks for this great project.

I am in the process of switching from Apollo Federation to Mercurius and am running into a few problems. Everything I describe here works with Apollo Federation and I would like to continue doing the same. Here's the problem:

I am using the same schemas in different services such as meta information, person, address, etc. These basic schemas are in a separate service. These schemas are then used in another service via @extends/@external and extended if necessary. Unfortunately this does not work and I always get the following feedback from the gateway:

"message": "Cannot return null for non-nullable field Meta.status."

Query:

{
  customer {
    meta {
      message
      status
    }
    data {
      _id
      name
    }
  }
}

If I do the query directly on the respective service it works. Therefore I think it is the gateway or the merging of the schemas. I have created an example repo. Can someone help me?

Example Repo: https://github.com/HashDot/federation-example

@mcollina
Copy link
Contributor

Thanks for reporting! I currently do not have much time to diagnose this but I'm happy to review any PRs.

@HashDot
Copy link
Author

HashDot commented Mar 30, 2021

Thanks for your quick reply. Then I will try another variant in the meantime and when I have time I will take a closer look. But maybe someone else has an idea what it is.

@mcollina mcollina added the bug Something isn't working label Mar 31, 2021
@alex-parra
Copy link

Hi @HashDot
I've looked into your federation-example repo but as far as I can tell the graphql schemas are loaded from the vault which isn't provided.

Have you looked at the gateway example which includes @extends cross service and works as expected?
What's different from your setup/needs?

The test extends-directive also implements extends cross service.

Please detail if there's a scenario not being covered by the existing tests.

@HashDot
Copy link
Author

HashDot commented Apr 20, 2021

Hi @alex-parra thanks for your response. I've tried to fill in the services without the vault and the result is the same. I try to build a better and less complex example of my problem for better debugging.

@alex-parra
Copy link

@HashDot sounds good!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants