diff --git a/src/Codegen/Generator.hack b/src/Codegen/Generator.hack index f68c762..ae2bde3 100644 --- a/src/Codegen/Generator.hack +++ b/src/Codegen/Generator.hack @@ -242,7 +242,11 @@ final class Generator { } foreach ($classish_objects as $class) { - if (\is_subclass_of($class->getName(), \Slack\GraphQL\Pagination\Connection::class)) { + $rc = new \ReflectionClass($class->getName()); + if ( + \is_subclass_of($class->getName(), \Slack\GraphQL\Pagination\Connection::class) && + $rc->getAttributeClass(\Slack\GraphQL\ObjectType::class) + ) { invariant( Str\ends_with($class->getName(), 'Connection'), "All connection types must have names ending with `Connection`. `%s` does not.", diff --git a/src/Pagination/Connection.hack b/src/Pagination/Connection.hack index 1328d09..2567a04 100644 --- a/src/Pagination/Connection.hack +++ b/src/Pagination/Connection.hack @@ -57,6 +57,7 @@ abstract class Connection { * * This should be the Hack class over which you want to paginate. */ + <<__Enforceable>> abstract const type TNode; /**