Never Poke Monkeys

    @envelop/apollo-server-errors
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.4 • Public • Published

    @envelop/apollo-server-errors

    This plugin exposes the same error structure as apollo-server. Use this plugin if you are moving to Envelop, and wish to get a compatibility layer for your errors, to make sure the clients receive the same output.

    Getting Started

    yarn add @envelop/apollo-server-errors
    

    Usage Example

    import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
    import { envelop, useEngine } from '@envelop/core'
    import { useApolloServerErrors } from '@envelop/apollo-server-errors'
    
    const getEnveloped = envelop({
      plugins: [
        useEngine({ parse, validate, specifiedRules, execute, subscribe }),
        // ... other plugins ...
        useApolloServerErrors({
          // All fields are optional, and should match what you pass today to ApolloServer
          debug: true, //
          formatError: () => {}
        })
      ]
    })

    Keywords

    none

    Install

    npm i @envelop/apollo-server-errors

    DownloadsWeekly Downloads

    2,798

    Version

    4.0.4

    License

    MIT

    Unpacked Size

    5.22 kB

    Total Files

    7

    Last publish

    Collaborators

    • dotansimha