feat: adds support for the @interfaceObject
directive
#218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The Apollo team are working on a new release for the Federation spec. This release will bump the spec to
v2.3
and one of the main features is the support for referencing Entities that are interfaces. You can read more about this here, and check the initial implementation here.Description
In this PR I'm addressing two minor things:
@interfaceObject
for theObject
classv2.3
@link(url: "https://specs.apollo.dev/federation/v2.3", as: "fed2")
)Considerations
v2.3
is that we can't apply@key
directive on interfaces for versions lower thanv2.3
. Also, if we do (inv2.3+
), we need to make sure all the implementing types also have the@key
directive. (According to this)Regarding the consideration above, let me know if you think it makes sense to add it part of this PR or it can be added after we get this one in. Currently, we need the existing changes to support the new features in
v2.3
, but I'm willing to add the extra validations so we have a consistent implementation of thev2.3
spec support.