graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Use NodeResolver on interface or abstract types

Open glucaci opened this issue 2 years ago • 4 comments

As an attempt to fix #5414 will start this PR. For the moment just added tests which are failing because NodeResolver don't support interface or abstract class.

glucaci avatar May 01 '23 09:05 glucaci

/azp run

michaelstaib avatar May 01 '23 21:05 michaelstaib

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar May 01 '23 21:05 azure-pipelines[bot]

@michaelstaib

  • I have enabled the usage of interfaces in NodeResolverTypeInterceptor however it's still an open point the RelayIdFieldHelpers.ApplyIdToField which supports only ObjectFieldDefinition and rely heavy on this implementation.

  • I have added one more tests with Query12 which is using abstract class/record and it's shaping this as an interface on the schema. I think this will be a nicer way to represent it by default (schema for Query11 is the default representation).

  • On the representation of Query11 I think is wrong that the derived type don't implements the abstract one on the schema, this is also another point for which I think we should change the abstract class/record to interface

  • One more question would be the type discovery, in the tests I've registered the derived type manually, but I think this should be added by default on the schema (all the derived typed of the NodeResolver return type).

glucaci avatar May 02 '23 17:05 glucaci

Sorry for the delay ... I will now look at this one.

michaelstaib avatar May 10 '23 05:05 michaelstaib