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

rover supergraph compose errors are missing the code and details #2421

Closed
mostafao-spotify opened this issue Feb 25, 2025 · 2 comments · Fixed by #2422
Closed

rover supergraph compose errors are missing the code and details #2421

mostafao-spotify opened this issue Feb 25, 2025 · 2 comments · Fixed by #2422
Labels
bug 🐞 triage issues and PRs that need to be triaged

Comments

@mostafao-spotify
Copy link

Description

I was testing the new Rover v0.27.0 using a simple test with rover supergraph compose, but the results were inconsistent between v0.27.0 and v0.26.3, the returned output in v0.27.x were always missing the code and details and there was no mention in the release notes or the documentation about this change in behavior.

Steps to reproduce

  1. Create a schema file and name it fed-service-1.graphqls, the use this content in it:
@key("randomStuff")
type Query {
    field1: String!
}
  1. Create a schema file and name it fed-service-2.graphqls, the use this content in it:
type Query {
    field2: String!
}
  1. Run the following command line in your terminal, once using rover v0.26.3 then again using v0.27.0
    (Note: you can also use rover npm to alternate between versions with ease)
echo 'federation_version: =2.9.3
subgraphs:
  fed-service-1:
    routing_url: http://localhost:8080/fed-service-1
    schema:
      file: ./fed-service-1.graphqls
  fed-service-2:
    routing_url: http://localhost:8080/fed-service-2
    schema:
      file: ./fed-service-2.graphqls
' | rover supergraph compose --config - --format json --output='./output.json'

Expected result

In version v0.26.3, the error details and code were correctly included in output.json

{"data":{"success":false},"error":{"code":"E029","details":{"build_errors":[{"code":"INVALID_GRAPHQL","message":"[object Object]","nodes":[{"end":null,"source":"@key(\"randomStuff\")\ntype Query {\n    field1: String!\n}","start":null,"subgraph":"fed-service-1"}],"omittedNodesCount":0,"type":"composition"}]},"message":"Encountered 1 build error while trying to build a supergraph."},"json_version":"1"} 

Actual result

In version v0.27.x, the error details and code were always missing in output.json, the result was:

{"json_version":"1","data":{"success":false},"error":{"message":"Encountered 1 build error while trying to build a supergraph.","code":null}}

Environment

Running rover info result:

Rover Info:
Version: 0.27.0
Install Location: /Users/<myusername>/.nvm/versions/node/v22.12.0/lib/node_modules/@apollo/rover/binary/rover-0.27.0
OS: Mac OS 15.3.1 [64-bit]
Shell: /opt/homebrew/bin/zsh
@jonathanrainer
Copy link
Contributor

Hi @mostafao-spotify had a look at this and raised a PR for a fix, hopefully this will go out in our next minor version which is not very far away!

Thanks for spotting this

@mostafao-spotify
Copy link
Author

Glad to be of help and thanks for sending the fix pr! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 triage issues and PRs that need to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants