-
Notifications
You must be signed in to change notification settings - Fork 93
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
Unable to generate Federation schema with no @Query functions #2110
Comments
@jmartisk I have encountered this problem too. At the moment samllrye graphql does not support working with federations in full. An example of a schema using federation (maybe not entirely correct, but it reflects the essence)
The option when only id information is returned in this type definitely works. When Role is a field of another type, from the request. However, according to the federation specification, the schema may not contain any requests. But it can extend types, such as Role. At the moment, this can be done a little incorrectly. For example, add an explicit request.
Most likely, this type of variant will not work
Or there is nothing about this in the documentation and I just did not find / did not understand how it works. Or it really is not implemented.
The main problem here is that with federation I can get a Role with many external fields received from different services and provide additional fields based on them. At the same time, without revealing information about how this will be done (without creating queries). While someone reads and responds to this comment, I will try to either figure it out or prepare a fix in some form. |
@jmartisk @t1 @phillip-kruger I need your opinion. Here is an example of how federation works from Apollo written in NodeJs Here is an example of a situation where there are no explicit requests, but the scheme is valid and fulfills its role. Essentially these are 4 different services, but have only two endpoints. Now smallrye graphql (or rather graphql-java) does not allow building a schema if there are no queries. Please look at the PR #2180 and the code I attached (quarkus-federation-demo.zip). What do you think about this? Is this necessary or not? This is the first version, without tests, documentation and other things. If necessary, I'll add it. |
Maybe this is a bit edge case but it's valid for federation and I can't quite figure out how to achieve it. I would like to generate a schema like:
However with smallrye-graphql I need at least 1 query for it to build the schema and then invoke the Federation transformer to add the additional
entities
query that allows for this usecase. The only thing I can think of is that when it checksschema.hasOperations())
inBootstrap.java
it should also check to see if it will generate theentities
query.The text was updated successfully, but these errors were encountered: