ApolloGateway doesn't recognize federation-jvm hosted graphql
See original GitHub issue _query { _service { sdl } }
on federation-jvm gives
{
"errors": [],
"data": {
"_service": {
"sdl": "schema {\n query: Query\n}\n\ntype Query {\n me: User\n}\n\ntype User @key(fields : \"id\") {\n id: ID!\n name: String\n username: String\n}\n"
}
},
"extensions": null,
"dataPresent": true
}
while ApolloGateway is expecting a different format with the same schema.grapql file:
{
"data": {
"_service": {
"sdl": "extend type Query {\n me: User\n}\n\ntype User @key(fields: \"id\") {\n id: ID!\n name: String\n username: String\n}\n"
}
}
}
https://github.com/apollographql/federation-demo/blob/master/services/accounts/index.js#L4
ApolloGateway doesn’t like the empty Array in .errors
. ApolloGateway considers this as not having a schema, and it also complains when having schema {\n query: Query\n}\n\n
in sdl.
Once the sdl string is patched and the empty array .errors
is removed, the Graphql schema defined in federation-jvm starts to appears on ApolloGateway.
snippet to patch the sql string:
final String modified = sdl.replace("schema {\n query: Query\n}\n\n", "");
_service.put("sdl", modified);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Introduction to Apollo Federation - Apollo GraphQL Docs
With federation, you can responsibly share ownership of your supergraph across any number of teams. And even if you currently only have one...
Read more >Building scalable solutions with Apollo Federation and Fauna
This article explains how you can reduce complexity, develop features faster, and make your engineering teams more efficient using Apollo ...
Read more >Federation | NestJS - A progressive Node.js framework
This method is triggered by the Apollo Gateway whenever a related resource requires a User instance. We'll see an example of this in...
Read more >Monitor Apollo Server with OpenTelemetry - New Relic
One of the benefits of using GraphQL language is that it makes it ... so if a query runs through multiple resolvers you...
Read more >Implementing a GraphQL gateway with Fastify - NearForm
GraphQL integration with caching of both query parsing and validation. Automatic loader integration to avoid 1+N queries (see this video ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The first part is a non-issue in the spring-example. (
.errors:[]
was introduced because we serializedExecutionResult
directly.)So, the only problem is with the
schema {\n query: Query\n}
in the sdl@kenshih @areidt84 @omarsallah00 I believe your issues are similar to #23 , which ended up being a bug in
graphql-java
’sSchemaPrinter
. We’ve patched their printer infederation-jvm
v0.3.4 and above, let me know if you’re still experiencing issues and I can reopen this issue.