mage2tv / module-apollo-boost-amd

mage2tv/module-apollo-boost-amd

The popular apollo-boost graphql library transpiled to AMD, wrapped in a Magento 2 module.

magento2-module 2.4.6-2.4.9 Compatible Based on composer requirements only QA: passed MIT

Apollo-Boost AMD module

The popular apollo-boost library
transpiled to AMD and wrapped in a Magento 2 module.

Usage:

  • Install mage2tv/module-apollo-boost-amd

  • In your JavaScript AMD modules, require 'apollo-boost'

  • Use the "exported" ApolloClient and gql function:

const client = new ApolloAmd.ApolloClient();
const query = ApolloAmd.gql(my_graphql_query);

// or: 

const {ApolloClient, gql} = ApolloAmd;

Example:

define(['uiComponent', 'apollo-boost'], function (Component, ApolloAmd) {
    'use strict';

    const {ApolloClient, gql} = ApolloAmd;

    const client = new ApolloClient({url: '/graphql'});
    const query = gql(`
                query exampleProducts($count: Int = 1) {
                  products(filter: {} pageSize: $count sort: { name: DESC }) {
                    total_count
                    items {
                      id
                      type_id
                      name
                      sku
                    }
                  }
                }
    `);


    return Component.extend({
        defaults: {
            tracks: {
                result: true
            }
        },
        initialize: function () {
            client.query({
                query: query,
                variables: {
                    count: 3
                }
            })
            .then(data => {
                this.result = data;
            })
            .catch(console.error);
            return this._super();
        }
    });
});

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Released
0.3.1.1 stable Pass 2019-05-28 07:36:28

Requires 1

Package Constraint
php >=7.0.0
QA results
Tool Status Findings Summary
PHPCS Pass 0
PHPStan Pass 0
Cpd Pass 0
Security Pass 0
License
MIT
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.