Skip to content

Commit

Permalink
Merge pull request #404 from amit-webkul/doc-updates
Browse files Browse the repository at this point in the history
Adding graphql API
  • Loading branch information
devansh-webkul authored Oct 23, 2024
2 parents e3db3da + aeb43e0 commit 6ad13e4
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.vuepress/version-configs/2.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ module.exports = [
collapsable: true,
children: setVersionPrefix([
['api/getting-started-with-the-api', 'Rest API'],
['api/graphql-api', 'GraphQL API'],
])
},
]
5 changes: 5 additions & 0 deletions docs/2.2/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
## REST API

The Bagisto REST API supports REST (Representational State Transfer) and provides access to CRUD (Create, Read, Update, Delete) operations. It also supports pagination to increase the performance of the application. The Bagisto REST API can be used to build a PWA (Progressive Web Application) application, integrate an online shopping mobile application with the Bagisto store.

## GraphQL API

Bagisto's GraphQL API enables a seamless, headless eCommerce experience built on Laravel. This API delivers ultra-fast, dynamic, and personalized shopping experiences through a scalable, open-source platform.

57 changes: 57 additions & 0 deletions docs/2.2/api/graphql-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Bagisto APIs

[[toc]]

## GraphQL API

Bagisto REST API is a medium to use the features of the core Bagisto System. By using Bagisto REST API, you can integrate your application to serve the default content of Bagisto.

## Explore GraphQL API Demo

Welcome to our API demo! Dive into the interactive showcase of our API functionalities to get a hands-on experience of how our platform works. Click the Link below to access the demo:

[Access REST API Demo](https://demo.bagisto.com/mobikul-common/)

#### Installation of GraphQL API

To Install Bagisto GraphQL API, you need to follow some steps.

- To install Bagisto GraphQL API from your console:

~~~
composer require bagisto/graphql-api ^v2.2.2
~~~

- In the ```app/Http/Kernel.php``` file, move the following middleware from the web section in the ```middlewareGroups``` array to the global middleware array:

~~~
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
~~~

- Add the following entries to your .env file to configure JWT settings.

~~~
JWT_TTL=525600
JWT_SHOW_BLACKLIST_EXCEPTION=true
~~~

- Run the command below to publish assets and configurations for Bagisto GraphQL:

~~~
php artisan bagisto-graphql:install
~~~

- After installation, you can test your API through the GraphQL Playground. Visit:

~~~
http://your-domain.com/graphiql
~~~

- Alternatively, you can test the API using Postman by accessing:

~~~
http://your-domain.com/graphql
~~~

You can check the <a href="https://github.com/bagisto/headless-ecommerce/tree/v2.2.2"> headless-ecommerce </a> github as well.

0 comments on commit 6ad13e4

Please sign in to comment.