From 4329e4098b6df02a927ddef476611f57d79955e4 Mon Sep 17 00:00:00 2001 From: andris-sevcenko Date: Tue, 30 Nov 2021 11:45:07 +0200 Subject: [PATCH] Add additional queries to funnel information to the sourcing plugin. Address craftcms/gatsby-source-craft#58 --- CHANGELOG.md | 3 +++ src/gql/queries/Sourcing.php | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f66fb0..2bdd1b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Added +- Add additional queries to funnel information to the sourcing plugin. ([craftcms/gatsby-source-craft#58](https://github.com/craftcms/gatsby-source-craft/issues/58)) + ### Changed - Exposed interface names are now correctly prefixed. ([craftcms/gatsby-source-craft#58](https://github.com/craftcms/gatsby-source-craft/issues/58)) diff --git a/src/gql/queries/Sourcing.php b/src/gql/queries/Sourcing.php index 8b5a51a..aeab043 100644 --- a/src/gql/queries/Sourcing.php +++ b/src/gql/queries/Sourcing.php @@ -88,6 +88,21 @@ public static function getQueries($checkToken = true): array 'resolve' => DeletedNodeResolver::class . '::resolve', 'description' => 'Return the list of nodes deleted since a point in time.' ], + 'gatsbyHelperVersion' => [ + 'type' => Type::string(), + 'resolve' => function () { + return Plugin::getInstance()->version; + }, + 'description' => 'Return the verison of the currently installed Helper plugin version.' + ], + 'gqlTypePrefix' => [ + 'name' => 'gqlTypePrefix', + 'type' => Type::string(), + 'resolve' => function () { + return Craft::$app->getConfig()->getGeneral()->gqlTypePrefix; + }, + 'description' => 'Return the value of the `gqlTypePrefix` config setting.' + ] ]; } }