oxid-esales/graphql-example

This package is abandoned and no longer maintained. The author suggests using the oxid-esales/graphql-catalogue package instead.

OXID eSales GraphQL example module

Installs: 68

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 14

Forks: 1

Type:oxideshop-module

v1.1.0 2019-12-10 13:12 UTC

This package is auto-updated.

Last update: 2020-07-06 09:50:35 UTC


README

Status Build Status PHP Version Stable Version

This module is abandoned. Please look at oxid-esales/graphql-catalogue for good examples instead.

This module provides a basic example on how to extend the oxid-esales/graphql-base module.

Usage

This assumes you have the OXID eShop up and running and installed and activated the oxid-esales/graphql-base module.

DO NOT USE IN PRODUCTION, THIS MODULE IS FOR DEMO PURPOSES ONLY

Install

$ composer require oxid-esales/graphql-example

After requiring the module, you need to head over to the OXID eShop admin and activate the GraphQL Example module.

How to use

  1. Install oxid-esales/graphql-base module
  2. Get token (see base module documentation)
  3. Execute example query to get all categories

Request query

query {
  categories {
    id
    name
  }
}

Response example

{
    "data": {
        "categories": [
            {
                "id": "30e44ab83fdee7564.23264141",
                "name": "Bekleidung"
            },
            {
                "id": "943173edecf6d6870a0f357b8ac84d32",
                "name": "Wakeboarding"
            },
            {
                "id": "943a9ba3050e78b443c16e043ae60ef3",
                "name": "Kiteboarding"
            },
            {
                "id": "fadcb6dd70b9f6248efa425bd159684e",
                "name": "Angebote"
            },
            {
                "id": "oia9ff5c96f1f29d527b61202ece0829",
                "name": "Downloads"
            }
        ]
    }
}

Testing

Linting, syntax, static analysis and unit tests

$ composer test

Integration tests

  • install this module into a running OXID eShop
  • change the test_config.yml
    • add oe/graphql-example to the partial_module_paths
    • set activate_all_modules to true
$ ./vendor/bin/runtests

License

GPLv3, see LICENSE file.