ivome/graphql-relay-php

Componentise into types (ConnectionType, EdgeType, PageInfoType, etc)

torreytsui opened this issue · 0 comments

Motivation

I have use cases to implement using a stricter typed system.

That is, in my domain, I implement custom types to extends ObjectType.

Before

However, that is impossible if we use this library, because it configs the object type using the helper functions:

  • Relay::connectionType(...): ObjectType
  • Relay::edgeType(...): ObjectType
  • etc

After

We can make it more flexible by introducing more granular Relay compliant types

  • Relay::connectionType(...): ConnectionType
  • Relay::edgeType(...): EdgeType

This also make the components more flexible (open-closed principle?!)

class MyCustomType extends ConnectionType
{
}

What do you think?