/oxid-api-workshop

OXID API Workshop

GNU General Public License v3.0GPL-3.0

oxid-api-workshop

OXID GraphQl API Workshop 2021-06-25

Example 1

As customer I want to set a 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!
}

Example module - https://github.com/hkreuter/oxid-customergraph

Example 2

As admin user of (groups oxidadmin, oxidadmingraph) I want to query the count of orders created in a specified timeframe

type AdminOrders
{
    dateFrom: DateTime
    dateTo: DateTime
    ordersCount: int!
    orders: [Order]!
}

type Query {
    adminOrders (
        dateFrom: DateTime
        dateTo: DateTime
    ):  AdminOrders!
}

Example module - https://github.com/hkreuter/oxid-admingraph

Example 3

As customer I want to use an autocomplete product search powered by GraphQL.

Useful links