0.2.6 • Published 5 months ago

@bouygues-telecom/spl-envelop-plugin v0.2.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Simple Predicate Langage (SPL)

NPM Version

SPL is a very small, lightweight, straightforward and non-evaluated expression language to sort, filter and paginate arrays of maps.

This package is a GraphQL Envelop plugin of the @SPL directive, bringing SPL capabilities to your GraphQL API.

Usage

query GetUsers {
  users @SPL(query: "SORT BY age LIMIT 3") {
    name
    age
  }
}

Getting Started

To use the SPL Envelop plugin, you need to:

  1. Install the package:

    npm install @bouygues-telecom/spl-envelop-plugin
  2. Import the plugin in your GraphQL Mesh configuration:

    // ...
    import { splDirectiveTypeDef } from '@bouygues-telecom/spl-envelop-plugin'
    
    export const composeConfig = defineConfig({
      // ...
      additionalTypeDefs: /* GraphQL */ `
        ${splDirectiveTypeDef}
      `,
    })
  3. Add the plugin to your GraphQL Mesh configuration:

    // ...
    import { useSPL } from '@bouygues-telecom/spl-envelop-plugin'
    
    export const composeConfig = defineConfig({
      // ...
      plugins: [
        useSPL(),
      ],
    })
0.2.6

5 months ago

0.2.5

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago