Laravel eCommerce headless APIs allow you to experience seamless and easily scalable storefront performance. The open-source headless laravel platform built on GraphQL based Rest API delivers ultra-fast, dynamic, and personalized shopping experiences.
Read our documentation: Bagisto GraphQL API Docs
The Bagisto GraphQL API is made in collaboration with Ucraft Team
- Bagisto: v1.3.x
composer require bagisto/graphql-api
php artisan bagisto_graphql:install
- replace the admins array index with the below-mentioned value in 'providers' array:
'admins' => [
'driver' => 'eloquent',
'model' => Webkul\GraphQLAPI\Models\User\Admin::class,
]
- change the guard index value from api to admin-api like below mentioned:
'guard' => 'admin-api',
- change the path from 'graphql/schema.graphql' to 'packages/Webkul/GraphQLAPI/graphql/schema.graphql' for the register index under schema array index like below mentioned:
'schema' => [
'register' => base_path('vendor/bagisto/graphql-api/src/graphql/schema.graphql'),
],
- change the App\GraphQL\ path to Webkul\GraphQLAPI\ in all the indexes of namespace index:
'namespaces' => [
'models' => ['App', 'Webkul\\GraphQLAPI\\Models'],
'queries' => 'Webkul\\GraphQLAPI\\Queries',
'mutations' => 'Webkul\\GraphQLAPI\\Mutations',
'subscriptions' => 'Webkul\\GraphQLAPI\\Subscriptions',
'interfaces' => 'Webkul\\GraphQLAPI\\Interfaces',
'unions' => 'Webkul\\GraphQLAPI\\Unions',
'scalars' => 'Webkul\\GraphQLAPI\\Scalars',
'directives' => ['Webkul\\GraphQLAPI\\Directives'],
'validators' => ['Webkul\\GraphQLAPI\\Validators'],
],
JWT_TTL=525600
composer dump-autoload
php artisan optimize
http://example.com/graphql-playground
To check the customer's API (front APIs), you have to put all the shop schemas at the end in the schema file (i.e. packages/Webkul/GraphQLAPI/graphql/schema.graphql).
put all shop schemas #import /shop/*/*.graphql after #import /promotion/*.graphql this line.
http://example.com/graphql
That's it, now just execute the project on your specified domain.