Closed rocknrolaf closed 4 years ago
I forgot to mention the events for registering the type:
use craft\services\Gql;
use craft\events\RegisterComponentTypesEvent;
use craft\events\RegisterGqlTypesEvent;
Event::on(Gql::class, Gql::EVENT_REGISTER_GQL_TYPES, function(RegisterGqlTypesEvent $event) {
$event->types[] = HotspotType::class;
});
Event::on(
Fields::class,
Fields::EVENT_REGISTER_FIELD_TYPES,
function (RegisterComponentTypesEvent $event) {
$event->types[] = ImageHotspotsField::class;
}
);
Looks awesome! I'll integrate it as soon as possible. Thanks @rocknrolaf!
Supported as of 1.0.0 see 2826dbf
Hi there!
first of all thank you for the plugin! We wanted to use this plugin with the internal GraphQL functionality of Craft and found a solution. Maybe you could check it out and integrate it.
We added a HotspotType class to define the type and coordinates:
After that we extended from your field type. But maybe you would only have to add the "getContentGqlType" to your existing field type.