-
Notifications
You must be signed in to change notification settings - Fork 9
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
Discuss the effect on public schema of @internal
directive
#34
Comments
Hmmm, this is a crazy thought perhaps, but would it make sense to retain |
I personally would push for consistency over ease, so I'd require that |
Is this an issue that can happen with If we use the same name but different args that a different issue, but we could prevent this with look up checks. As for having it existing in one location vs all, we needed to support I have an existing shared type # Subgraph A
type Position @shareable {
x: Float
y: Float
}
# Subgraph B
type Position @shareable {
x: Float
y: Float
} Now I want to add a new field When I go and first update Subgraph A, should the change result in failed composition? Apollo Federation allows this today Making a change to Subgraph A, even if I upgrade Subgraph B in the same hour, should the supergraph be broken in that time? # Subgraph A
type Position @shareable {
x: Float
y: Float
z: Float @inaccessible
}
# Subgraph B
type Position @shareable {
x: Float
y: Float
} |
Thinking about it, this would require coordination so contrary to what I said before, the directive should be interpreted locally. I think @martijnwalraven's suggestion sounds reasonable:
|
In Federation v2, the
@inaccessible
directive (in our case it's called@internal
) hides a field from the end consumer of GraphQL API.What GraphQL API consumer sees:
I would say this approach (hiding a field if it's marked as internal at least once) is a good practice as it reduces chances of leaking a field to the public.
The opposite approach would be to mark a field as internal in all subgraphs that define the field (easy to leak something).
It becomes problematic with combination of the
@lookup
directive.I can imagine a situation where there are more than one lookup fields of the same name, and only the subset of them is meant to be used for querying data.
Here's what I mean:
In this example, a team that develops schema B, may want to limit the usage of the field to make it available only for the query planner, specifically the entity resolution (internal request to resolve a type based on its key).
What are your opinions? Should we introduce two different behaviors for
@internal
with and without@lookup
or stick to what we have today (At least one@internal
to hide a field completely).The text was updated successfully, but these errors were encountered: