5.0.0 • Published 7 months ago

@envelop/resource-limitations v5.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@envelop/resource-limitations

This plugins uses extended-validation concept (details here) for implementing a resource-limitations rate-limit similar to GitHub GraphQL API (see https://docs.github.com/en/graphql/overview/resource-limitations for more details)

Getting Started

yarn add @envelop/resource-limitations

Usage Example

import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine } from '@envelop/core'
import { useResourceLimitations } from '@envelop/resource-limitations'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useResourceLimitations({
      nodeCostLimit: 500000, // optional, default to 500000
      paginationArgumentMaximum: 100, // optional, default to 100
      paginationArgumentMinimum: 1, // optional, default to 1
      paginationArgumentScalars: ['ConnectionInt'], // optional, use if connections use a different scalar type as the argument instead of `Int`
      extensions: false // set this to `true` in order to add the calculated const to the response of queries
    })
  ]
})
4.0.1

9 months ago

4.0.3

8 months ago

4.0.2

8 months ago

5.0.0

7 months ago

4.0.0

12 months ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.5

1 year ago

3.0.0

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.2

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.3.3

2 years ago

2.3.2

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

2.0.0

2 years ago

2.1.0

2 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago