Thank you for the video!
I was very careful and it did not work.
Sorry for the many sentences!
I tried to install HeadlessEC(GraphQL) by referring to the video (v1.4.3), v1.4.3 and v2.0.1 README.md and comparing them.
Compared to v2.0.1, the following seemed to be necessary in summary, so I performed the following
put Headless EC(GraphQL) under Packages
(I ultimately found this unnecessary)
setup Headless EC v2.0.1 according to
README.md *1
https://github.com/bagisto/headless-ecommerce/blob/v2.0.1/README.md
*1 There are no steps to configure config/lighthouse.php
I ran it and it didn't work.
I have a question about README.md of v1.4.3 and differences between v1.4.3 Video and v2.0.1 README.md, etc. I would appreciate it if you could check.
■Questions.
1.
I tried to install Headless EC on Bagisto 2.1.2 with the following
Result: Failure error
composer require bagisto/graphql-api:2.0.1
composer require bagisto/graphql-api:2.0.0
Result: Success
composer require bagisto/graphql-api dev-main
I can only install dev-main, is this normal?
Can I continue to use this in production?
1.
Symfony\Component\ErrorHandler\Error\FatalError
Declaration of Webkul\GraphQLAPI\Models\CatalogRule\CatalogRule::catalog_rule_products() must be compatible with Webkul\CatalogRule\Models\CatalogRule::catalog_rule_products(): Illuminate\Database\Eloquent\Relations\HasMany
at vendor/bagisto/graphql-api/src/Models/CatalogRule/CatalogRule.php:14
10▕ {
11▕ /**
12▕ * Get the Catalog rule Product that owns the catalog rule.
13▕ */
➜ 14▕ public function catalog_rule_products()
15▕ {
16▕ return $this->hasMany(CatalogRuleProductProxy::modelClass());
17▕ }
18
2.
Whoops\Exception\ErrorException
Declaration of Webkul\GraphQLAPI\Models\CatalogRule\CatalogRule::catalog_rule_products() must be compatible with Webkul\CatalogRule\Models\CatalogRule::catalog_rule_products(): Illuminate\Database\Eloquent\Relations\HasMany
at vendor/bagisto/graphql-api/src/Models/CatalogRule/CatalogRule.php:14
10▕ {
11▕ /**
12▕ * Get the Catalog rule Product that owns the catalog rule.
13▕ */
➜ 14▕ public function catalog_rule_products()
15▕ {
16▕ return $this->hasMany(CatalogRuleProductProxy::modelClass());
17▕ }
18▕
3.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
Please let me know which combination of Bagisto and HeadlessEC (GraphQL) can be used as a stable version.
Currently, it's not clear what version is compatible with what,
I am trying various versions.
I am very confused.
My goal is to use HeadlessEC(GraphQL) with Bagisto v2.1.2.
I saw on Github that Headless EC(GraphQL) v2.0.1 only works with Bagisto v2.0.0.
This time I was told that Bagisto v2.1.2 could be used, so I tried again, but it still did not work.
Is it correct that there is no way to use Headless EC(GraphQL) v2.0.1 with Bagisto v2.1.2?
(The HasMany fixes have already been applied but did not work).
The error in Laravel is always the same as below.
I also looked here and it seems that some CLASS files do not exist.
local.ERROR: Failed to find class Webkul\CMS\Models\CmsPage in namespaces [App, Webkul\GraphQLAPI\Models] for directive @paginate. {"exception":"[object] (Nuwave\\Lighthouse\\Exceptions\\DefinitionException(code: 0): Failed to find class Webkul\\CMS\\Models\\CmsPage in namespaces [App, Webkul\\GraphQLAPI\\Models] for directive @paginate. at /var/www/html/bagisto/vendor/nuwave/lighthouse/src/Schema/Directives/BaseDirective.php:190)
I don't think I need to manually put graphql-api in pakages/Webkul in v.2.0.1, is that correct?
The result of the installation with the command,
I thought that I don't need to put it in pakages/Webkul again because it is in bagisto/vendor/bagisto/graphql-api.
bagisto/vendor/bagisto/graphql-api/composer.json
This is also why there is also the following statement in
"autoload": {
"psr-4": {
"Webkul\\GraphQLAPI\\": "src/"
}
},
bagisto/config/lighthouse.php
I believe it can also be referenced in namespaces in
(It should also automatically integrate with bagisto/composer.json)
I only found in the video about adding to bagisto/config/app.php providers.
*Not mentioned in README.md.
Webkul\GraphQLAPI\Providers\GraphQLAPIServiceProvider::class,
Is this one still required in v2.0.1?
I found this, so I don't believe it is currently needed.
(It is loaded by extra (discovery function))
bagisto/vendor/bagisto/graphql-api/composer.json
"extra": {
"laravel": {
"providers": [
"Webkul\\GraphQLAPI\\Providers\\GraphQLAPIServiceProvider"
],
"aliases": {}
}
},
In the video, I had first placed the package I had DL'd from GitHub myself under bagisto/packages/Webkul,
In addition, I did the following command,
composer require bagisto/graphql-api
php artisan bagisto_graphql:install
I don't think it's necessary, since it's a double configuration under the vendor, but is it necessary?
I'm sorry if I'm wrong.
vendor
bagisto/packages/Webkul
I feel it will be difficult to manage version upgrades in the future if I put them in two separate files.
As of v2.0.1, I don't put packages that I downloaded from GitHub under bagisto/packages/Webkul.
Is this correct?