@slickgrid-universal/graphql
TypeScript icon, indicating that this package has built-in type declarations

5.4.0 • Public • Published

License: MIT TypeScript lerna--lite npm npm npm bundle size

Actions Status Cypress.io jest codecov

GraphQL Service

@slickgrid-universal/graphql

GraphQL Service to sync a grid with an GraphQL backend server, the service will consider any Filter/Sort and automatically build the necessary GraphQL query string that is sent to your GraphQL backend server.

Internal Dependencies

External Dependencies

No external dependency

Installation

Follow the instruction provided in the main README, you can see a demo by looking at the GitHub Demo page.

Usage

Simply use pass the Service into the backendServiceApi Grid Option.

ViewModel
import { GraphqlService, GraphqlServiceApi } from '@slickgrid-universal/graphql';

export class MyExample {
  initializeGrid {
    this.gridOptions = {
      backendServiceApi: {
        service: new GraphqlService(),
        options: {
          datasetName: 'users',
        },
        preProcess: () => this.displaySpinner(true),
        process: (query) => this.getCustomerApiCall(query),
        postProcess: (response) => {
          this.displaySpinner(false);
          this.getCustomerCallback(response);
        }
      } as GraphqlServiceApi
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @slickgrid-universal/graphql

Weekly Downloads

279

Version

5.4.0

License

MIT

Unpacked Size

308 kB

Total Files

109

Last publish

Collaborators

  • ghiscoding