-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from magefan/6821-pwa-blog-integration
Add PWA studio 12 compatibility
- Loading branch information
Showing
14 changed files
with
286 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare (strict_types = 1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogArchiveTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_ARCHIVE = 'MF_BLOG_ARCHIVE'; | ||
const TYPE_RESOLVER = 'blogPostsOutput'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_ARCHIVE) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare (strict_types = 1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogAuthorTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_AUTHOR = 'MF_BLOG_AUTHOR'; | ||
const TYPE_RESOLVER = 'BlogAuthor'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_AUTHOR) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogCategoryTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_CATEGORY = 'MF_BLOG_CATEGORY'; | ||
const TYPE_RESOLVER = 'BlogCategory'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_CATEGORY) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogIndexTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_INDEX = 'MF_BLOG_INDEX'; | ||
const TYPE_RESOLVER = 'blogPostsOutput'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_INDEX) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogPostTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_POST = 'MF_BLOG_POST'; | ||
const TYPE_RESOLVER = 'BlogPost'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_POST) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare (strict_types = 1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogSearchTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_SEARCH = 'MF_BLOG_SEARCH'; | ||
const TYPE_RESOLVER = 'blogPostsOutput'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_SEARCH) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Copyright © Magefan ([email protected]). All rights reserved. | ||
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement). | ||
*/ | ||
|
||
declare (strict_types = 1); | ||
|
||
namespace Magefan\BlogGraphQl\Model; | ||
|
||
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
class BlogTagTypeResolver implements TypeResolverInterface | ||
{ | ||
const MF_BLOG_TAG = 'MF_BLOG_TAG'; | ||
const TYPE_RESOLVER = 'BlogTag'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function resolveType(array $data) : string | ||
{ | ||
if (isset($data['type_id']) && $data['type_id'] == self::MF_BLOG_TAG) { | ||
return self::TYPE_RESOLVER; | ||
} | ||
return ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.