Nexus: Can interfaceType() implement another interface?

Created on 24 Feb 2020  路  2Comments  路  Source: graphql-nexus/nexus

Hi all,
I have a question - can the interfaceType() implement another interface? The GraphQl spec allows it (details here).

Example:

const interfaces = {
  IProfile: interfaceType({
    name: 'IProfile',
    definition(t) {
     // throws "Property 'implements' does not exist on type 'InterfaceDefinitionBlock<"IProfile">"
     t.implements('Node')
    }
}

My use case is to add the basic Node interface into another one. Not exactly blocking or anything but it would be nice :)

Also, I'd like to take this opportunity to thank you for this amazing library :)) Sometimes we have to fight the generated typings a little bit but in general, it works like a charm 馃檹 馃憦

typfeat

Most helpful comment

I'd also highly appreciate to have the possibility to "bundle" multiple interfaces into a "higher level" interface. This would remove many many code duplication.

Any progress on this topic since February?

All 2 comments

I have a question - can the interfaceType() implement another interface? The GraphQl spec allows it (details here).

Ah neat, I remember this being a proposal but didn't know it landed. Looks like it's supported in th 15.x rc's, will look to add this in there

Also, I'd like to take this opportunity to thank you for this amazing library :)) Sometimes we have to fight the generated typings a little bit but in general, it works like a charm 馃檹 馃憦

Awesome, glad to hear you're enjoying it!

I'd also highly appreciate to have the possibility to "bundle" multiple interfaces into a "higher level" interface. This would remove many many code duplication.

Any progress on this topic since February?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deadcoder0904 picture deadcoder0904  路  3Comments

ecwyne picture ecwyne  路  6Comments

hatchli picture hatchli  路  5Comments

MathiasKandelborg picture MathiasKandelborg  路  5Comments

DregondRahl picture DregondRahl  路  3Comments