OXID eShop GraphQL ExtendType Example
This assumes you have the OXID eShop up and running and installed and activated the oxid-esales/graphql-base
and oxid-esales/graphql-storefront
module.
$ composer require hkreuter/oxid-customergraph
After requiring the module, you need to head over to the OXID eShop admin and activate the module.
As customer I want to set as short (e.g max 254 characters) 'about me' description which is stored in an extra field in the oxuser table. Use ExtendType to extend Storefront module's Customer DataType so that the extra field can be queried in customer query.
type Customer
{
// ...
aboutMe: String!
}
type Mutation {
CustomerAboutMe (
aboutMe: String
): Customer!
}
$ composer test
- install this module into a running OXID eShop
- change the
test_config.yml
- add module to the
partial_module_paths
- set
activate_all_modules
totrue
- add module to the
$ ./vendor/bin/runtests
GPLv3, see LICENSE file.