I am trying to apply restrictions on a graphQL schema on a Java application, based on domain. I would like the whole schema to be restricted to the domain "admin.org".
However, I also want to be able to expose any query or mutation to "user.org", by excluding the particular query or mutation from the global restriction.
The only way I found yet, is to restrict each query with the FIELD_DEFINITION directive. That is something I would like to avoid since I don't want to add a rule in every new query I add to the API.
- Is this possible to implement with GraphQL directives?
- If it is not, is there another way to accomplish the desired result?