Skip to content

Commit

Permalink
Exposed interface names are now correctly prefixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
andris-sevcenko committed Nov 30, 2021
1 parent 97fee89 commit 9c07d1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## Unreleased

### Changed
- Exposed interface names are now correctly prefixed. ([craftcms/gatsby-source-craft#58](https://github.com/craftcms/gatsby-source-craft/issues/58))

### Fixed
- Fixed an error in the SQL query when fetching updated elements. ([#57](https://github.com/craftcms/gatsby-source-craft/issues/57))
- Fixed an error in the SQL query when fetching updated elements. ([craftcms/gatsby-source-craft#57](https://github.com/craftcms/gatsby-source-craft/issues/57))

## 1.0.8 - 2021-11-25

Expand Down
6 changes: 6 additions & 0 deletions src/services/SourceNodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@

use craft\base\Component;
use craft\gatsbyhelper\events\RegisterSourceNodeTypesEvent;
use craft\gql\GqlEntityRegistry;
use craft\gql\interfaces\elements\Asset as AssetInterface;
use craft\gql\interfaces\elements\Category as CategoryInterface;
use craft\gql\interfaces\elements\Entry as EntryInterface;
use craft\gql\interfaces\elements\GlobalSet as GlobalSetInterface;
use craft\gql\interfaces\elements\Tag as TagInterface;
use craft\gql\interfaces\elements\User as UserInterface;
use craft\helpers\Gql;
use craft\helpers\StringHelper;

/**
* SourceNodes Service
Expand Down Expand Up @@ -130,6 +132,10 @@ public function getSourceNodeTypes(): array

$this->trigger(self::EVENT_REGISTER_SOURCE_NODE_TYPES, $event);

foreach ($event->types as &$sourceNodeType) {
$sourceNodeType['targetInterface'] = GqlEntityRegistry::prefixTypeName($sourceNodeType['targetInterface']);
}

return $event->types;
}
}

0 comments on commit 9c07d1d

Please sign in to comment.