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: allow interfaces to implement other interfaces #496

Merged

Conversation

santialbo
Copy link
Contributor

@santialbo santialbo commented Aug 27, 2020

This is a initial draft for allowing interfaces to implement other interfaces which is one of the features coming with graphql v15.
Things I've considered:

  • No need to call t.implements with all the interfaces like it is required on grapqhl. It automatically pulls all the transitive "implements" when building the schema.
  • Check for circular dependencies before building the types in order to avoid stack overflow exceptions.

Please let me know if you prefer this to be handled in another way or if you would like me to add more tests and what kind of tests you would like to see.

BTW: I missed having some sort of autoformatter when working on this. Seeing that you use prettier on https://github.com/graphql-nexus/nexus would you accept a PR adding it here with the same config?

closes #389

@santialbo santialbo force-pushed the interface-implement-interface branch from 395d4bc to 4558aab Compare August 27, 2020 09:04
@tgriesser
Copy link
Member

Cool stuff, definitely want to get this in here. Mind getting it up-to-date with develop?

No need to call t.implements with all the interfaces like it is required on grapqhl. It automatically pulls all the transitive "implements" when building the schema.

Sounds like a good feature!

Check for circular dependencies before building the types in order to avoid stack overflow exceptions.

Nice

BTW: I missed having some sort of autoformatter when working on this. Seeing that you use prettier on graphql-nexus/nexus would you accept a PR adding it here with the same config?

Yeah, it definitely used to be in here. I'm guessing with all the shuffling around with Prisma things it got lost in the mix. Feel free to add!

@santialbo santialbo marked this pull request as ready for review October 8, 2020 17:28
@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #496 into develop will increase coverage by 0.02%.
The diff coverage is 96.36%.

@@             Coverage Diff             @@
##           develop     #496      +/-   ##
===========================================
+ Coverage    93.56%   93.58%   +0.02%     
===========================================
  Files           42       42              
  Lines         2438     2480      +42     
  Branches       504      509       +5     
===========================================
+ Hits          2281     2321      +40     
- Misses         157      159       +2     

@jasonkuhrt
Copy link
Member

Tests appear to be passing. NPM is having issues right now so can ignore that failure:

image

Copy link
Member

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

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

Thanks @santialbo !

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

Successfully merging this pull request may close these issues.

Can interfaceType() implement another interface?
3 participants