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

feat: adds support for the @interfaceObject directive #218

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

moonflare
Copy link
Contributor

@moonflare moonflare commented Jan 31, 2023

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:

  • Adds support for the @interfaceObject for the Object class
  • Adds support to link the latest version of v2.3
  • Fixes the custom namespace not being added to the SDL. (eg: @link(url: "https://specs.apollo.dev/federation/v2.3", as: "fed2"))

Considerations

  • We need to add a validation check in v2.3 is that we can't apply @key directive on interfaces for versions lower than v2.3. Also, if we do (in v2.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 the v2.3 spec support.

@dariuszkuc
Copy link

@grxy can you help out with the review of this PR?

Copy link
Collaborator

@grxy grxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great! If you could follow up with a PR to add the @key support you mentioned, that would be much appreciated. Also, for future PRs, it looks like you will need to allow Gusto CircleCI orbs so that you can run CI. See this build page for the failure that prevented it from running.

@grxy grxy merged commit c7b987d into Gusto:main Feb 21, 2023
grxy pushed a commit that referenced this pull request Feb 21, 2023
# [3.4.0](v3.3.1...v3.4.0) (2023-02-21)

### Bug Fixes

* address some lint violations ([#219](#219)) ([dcd11e9](dcd11e9))

### Features

* add support for the [@interface](https://github.com/interface)Object directive ([#218](#218)) ([c7b987d](c7b987d))
@grxy
Copy link
Collaborator

grxy commented Feb 21, 2023

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants