larsroettig / module-graphqlstorepickup
Demo Module for GraphQL
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 1
Forks: 3
Open Issues: 3
Type:magento2-module
Requires
- php: ~7.2.0||~7.3.0
- magento/framework: 102.0.*
Requires (Dev)
- composer/composer: *@dev
- dealerdirect/phpcodesniffer-composer-installer: dev-master
- jakub-onderka/php-parallel-lint: dev-master
- magento/magento-coding-standard: dev-master
- phpro/grumphp: dev-master
- phpunit/phpunit: *
- povils/phpmnd: ^2.1@dev
- roave/security-advisories: dev-master
- vimeo/psalm: ^3.0@dev
Suggests
- magento/module-graph-ql: 100.3.*
- magento/module-graph-ql-cache: 100.3.*
- magento/module-store-graph-ql: 100.3.*
This package is auto-updated.
Last update: 2024-10-28 21:41:04 UTC
README
Magento Module LarsRoettig_GraphQLStorePickup
Main Functionalities
I will show how you can build your GraphQL for Magento 2.3 and extend them with a filter logic. Our use case is a Pickup from Store endpoint what our frontend team needs to create an interactive map.
We are hire ! Wanna work for one of Germany’s leading Magento partners? With agile methods, small teams and big clients? We’re currently looking for experienced PHP & Magento developers in Munich/Rosenheim. Sounds interesting? Just drop me a line via l.roettig+github@techdivision.com
In the story, we have the following acceptance criteria.
As a frontend developer, I need Endpoint to search for the next Pickup Store in a Postcode Area. Use a setup script initial import Allow search for Postcode or Name. API will return the following attributes for a Pickup Store
❗ The Code is not for a production server it is only proof of concept imeplementation ❗
Features
- Create new Table with Declarative Schema
- Use Data Patch to import Sample Data
- Implement own GraphQL Endpoint with Filter Query
Tested on Version
- Magento 2.3.3
Installation
* = in production please use the --keep-generated
option
Type 1: Zip file
- Unzip the zip file in to
app/code/LarsRoettig/GraphQLStorePickup
- Enable the module by running
php bin/magento module:enable LarsRoettig_GraphQLStorePickup
- Apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
Type 2: Composer
- Install the module composer by running
composer require larsroettig/module-graphqlstorepickup
- enable the module by running
php bin/magento module:enable LarsRoettig_GraphQLStorePickup
- apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
How to use it
Possibly Query (https://your_domain.test/graphql)
Simple Query without an filter:
{ pickUpStores { total_count items { name street street_num postcode } } }
Query with an filter:
{ pickUpStores( filter: { name: { like: "Brick and Mortar 1%" } } pageSize: 2 currentPage: 1 ) { total_count items { name street postcode } } }