Gusto / apollo-federation-ruby

A Ruby implementation of Apollo Federation
MIT License
216 stars 76 forks source link

feat: Add entity interface support #265

Open rosscooperman opened 1 year ago

rosscooperman commented 1 year ago

This is a super minimal implementation of support for interfaces as entities. Really just enough to get our @interfaceObject + @key on interface setup working.

I don't expect this is anywhere near ready to merge but was hoping to get some feedback on the approach before I go further. Some things I know I will need to do (but didn't need for our specific purposes):

  1. Support underscore_reference_keys on interfaces. We don't happen to use it so I just guarded against calling it if it's not there but will need to add support to the ApolloFederation::Interface module.
  2. Will need to support resolve_type on the interface as opposed to the schema. Need to look into whether there's a consistent way in graphql-ruby to resolve an interface type that will have the framework check all relevant options -- probably is, just didn't look closely because we resolve all of our interface types through Schema.resolve_type.
  3. Tests.
rosscooperman commented 12 months ago

Thanks for working on this! Did you see this other PR where we're also talking about entity interface support? How do you feel about collaborating on that PR instead, since it's further along?

Sounds good to me!