envelop-no-alias
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

Envelop Plugin

This package is an envelop plugin version of graphql-no-alias validation directive.

Install

npm Install envelop-no-alias

Usage

import { envelop } from '@envelop/core'
import { useNoAlias, Config } from 'envelop-no-alias'

//optional configuration
const config: Config = {}
const getEnveloped = envelop({
  plugins: [useNoAlias(config)]
})

Or if you are using type definitions:

import { envelop } from '@envelop/core'
import { useNoAlias, createTypeDefinition } from 'envelop-no-alias'

//add type defintion to schema
const schema = buildSchema(`
  ${createTypeDefinition()}
  type Query {
    hello: String @noAlias(allow:2)
  }

  type Mutation @noAlias {
    muteOne(n:Int):String
  }
`)

const getEnveloped = envelop({
  plugins: [useNoAlias()]
})

Package Sidebar

Install

npm i envelop-no-alias

Weekly Downloads

474

Version

3.0.3

License

MIT

Unpacked Size

12.6 kB

Total Files

10

Last publish

Collaborators

  • ivandotv