Drupal GraphQL v4 automatic schema generation (first functional PoC)
Yay! first functional PoC for the GraphQL v4 module and the automatic schema generators for Drupal entities, so far what was done:
- Write a DataProducer Plugin that take advantage of a Plugin Derivative to register multiple DataProducer plugins depending on the number of ContentTypes on a site
- Programmatically register queries (singular & plural) for multiple Content Types
- Programmatically register resolvers for Connections on those Content Types
- Programmatically register resolvers for multiple Fields within a Content Type using addFieldResolver and providing support for composing Producers
Code is still really hacky but so far looks promising, I am just reusing the resolvers from open social also to reuse the Connection and other helpers
No need to have schema.base.graphqls or schema.extension.graphqls files, the SDL definitions are generated programmatically directly from the Drupal module.
At this very moment only string, string_long field types, and some other default Drupal Node fields as title, uid aka author got registered.
Since the work was based on OpenSocial, the uuid is used as id but seems like adding nid aka id field could be aded as drupal_id
GraphQL Compose module link
https://www.drupal.org/project/graphql_compose
Видео Drupal GraphQL v4 automatic schema generation (first functional PoC) канала Jesus Manuel Olivas
- Write a DataProducer Plugin that take advantage of a Plugin Derivative to register multiple DataProducer plugins depending on the number of ContentTypes on a site
- Programmatically register queries (singular & plural) for multiple Content Types
- Programmatically register resolvers for Connections on those Content Types
- Programmatically register resolvers for multiple Fields within a Content Type using addFieldResolver and providing support for composing Producers
Code is still really hacky but so far looks promising, I am just reusing the resolvers from open social also to reuse the Connection and other helpers
No need to have schema.base.graphqls or schema.extension.graphqls files, the SDL definitions are generated programmatically directly from the Drupal module.
At this very moment only string, string_long field types, and some other default Drupal Node fields as title, uid aka author got registered.
Since the work was based on OpenSocial, the uuid is used as id but seems like adding nid aka id field could be aded as drupal_id
GraphQL Compose module link
https://www.drupal.org/project/graphql_compose
Видео Drupal GraphQL v4 automatic schema generation (first functional PoC) канала Jesus Manuel Olivas
Комментарии отсутствуют
Информация о видео
16 марта 2022 г. 21:00:38
00:02:20
Другие видео канала