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

Allow root query type to be optional to support federation implementations better #667

Open
3 tasks done
mmuth opened this issue Jun 3, 2022 · 1 comment
Open
3 tasks done

Comments

@mmuth
Copy link

mmuth commented Jun 3, 2022

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Hi there, we are using graphql-java-kickstart to implement GQL microservices in conjunction with apollo federation. This basically works very good.

However, I'd like to propose the enhancement to make the root query type also optional (by configuration).

Background:
(at least in our setup) some microservices only extend types defined by other services and add fields to existing types. They never are requested "directly". Basically there is no need to define the query type at all for those services. Currently graphql-java-tools throws an exception when starting up like this (graphql.kickstart.tools.SchemaClassScannerError: Type definition for root query type 'Query' not found!).

Use Cases

Implementing services of a federation can easily add separate fields to entites without the need to define a top level query.

@enriquedacostacambio
Copy link

Maybe your set up is different, but while you source schema might lack a Query type, the federation-ready schema will always define one because of _entities and _service.
Perhaps you are trying to create an executable schema out of the original schema rather than the transformed federation-ready one? I never faced this issue, because I use the later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants