Skip to main content
Version: 4.1

Configuration

CoreShop Headless adds a new DataHub Type called CoreShop. This type is used to configure the GraphQL API. It extends from the Pimcore DataHub GraphQL Type. Therefore, we still need to have a DataHub Configuration with all the entities configured. CoreShop Headless provides a default config that can be used.

CoreShop Headless disables the default Pimcore Queries. This is done to not over expose the API with confidential data like Customers or Orders. The default config can be found here vendor/coreshop/headless-bundle/var/config/data_hub/coreshop.yml.

Authentication

For Authentication and Authorization, CoreShop Headless uses Symfony Security. We authenticate with a GraphQL Mutation that returns a JWT Token. For this to work, we need to configure the Symfony Firewall.


security:
firewalls:
coreshop_headless:
pattern: ^/pimcore-graphql-webservices/coreshop
provider: coreshop_user
stateless: true
jwt: ~

Command Bus

CoreShop Headless uses Symfony Command Bus to execute the queries and mutations. The design decision to use the Command Bus is to make it easier to extend the Headless Bundle with custom queries and mutations as well as extend or overwrite existing queries and mutations.

These Commands are sent synchronously to the Command Bus and are handled by a Command Handler. The Command Handler is responsible for executing the Command and returning the result.

Queries Overview

https://github.com/coreshop/CoreShop/issues/831

Mutations:

  • Authenticate
  • AddToOrder
  • RemoveOrderItem
  • UpdateOrderItem
  • AddOrderVoucherCode
  • RemoveOrderVoucherCode
  • PasswordResetRequest
  • PasswordResetRequestValidate
  • ResetPassword
  • CustomerRegistration
  • CheckoutGuestRegistration
  • CheckoutGuestAddress
  • CheckoutShipping
  • CheckoutPaymentProvider
  • CheckoutOrder
  • Payment
  • Logout
  • CreateCustomerAddress
  • DeleteCustomerAddress
  • UpdateMe

Queries:

  • Me
  • ActiveOrder
  • Order
  • Filter
  • Categories
  • Products
  • Product
  • LatestProducts
  • ProductPrice
  • Filter
  • CarrierList
  • PaymentProviderList
  • Product Pricing
  • currencies
  • locales?
  • addresses
  • carriers