Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Federation not fetching downstream simple query result type Int #33

Closed
tomi-bigpi opened this issue Apr 28, 2022 · 3 comments
Closed

Federation not fetching downstream simple query result type Int #33

tomi-bigpi opened this issue Apr 28, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@tomi-bigpi
Copy link
Contributor

I ran into an issue with a federated query that simply returns an Int. Calling the service directly (also running on Mercurius) returns the value as expected.

Relevant bit from the schema:

type Query {
  myCount: Int!
}

I'm not seeing any calls from the federation service to the downstream service, and calls fail with Cannot return null for non-nullable field Query.myCount.. Making the return type nullable causes a null to be returned.

Wrapping the result in a custom type, such as type MyAggregations { count: Int! } works as expected.

@mcollina
Copy link
Contributor

This is a tough bug that'll need to solve. Unfortunately it would take a while - my schedule is packed for the next couple of months.

If you would like to take a stab and fix it, it would be awesome:

@mcollina mcollina added the bug Something isn't working label Apr 28, 2022
@codeflyer codeflyer transferred this issue from mercurius-js/mercurius Nov 13, 2022
@codeflyer
Copy link
Collaborator

I've created a test file for this issue: #43

It seems to work properly.

@MrSaints
Copy link

MrSaints commented Aug 2, 2023

I know there's a test for it, but this still seems to be an issue when used with Python's Graphene Federation. It works fine using Apollo Federation / Gateway. Tested with both Int! and String! scalar types as the return on the root Query. It is fine if we use a custom type / object type.

EDIT: Issue is resolved when using extend type Query . Related to #23

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

No branches or pull requests

4 participants