1.1.1 • Published 30 days ago

unify-elysia-gql v1.1.1

Weekly downloads
-
License
-
Repository
-
Last release
30 days ago

unify-elysia-gql

Library to have GraphQL generic errors from unify-error library.

Support :

Usage

import { pluginUnifyElysiaGraphQL } from 'unify-elysia-gql';
const { handleQueryAndResolver } = pluginUnifyElysiaGraphQL(config);

const server = new Elysia()
  .use(
    yoga({
      typeDefs: `
        type Query {
          BadRequest: String!
        }
      `,
      resolvers: {
        Query: {
          BadRequest: handleQueryAndResolver(() => {
            throw new BadRequest({
              issue: 'This is the issue',
            });
          }),
        },
      },
    }),
  );

Return

namedescription
handleQueryAndResolverMap query and/or resolver callback
handleQueriesAndResolversMap array of queries and/or resolvers callback

Plugin options

namedefaultdescription
logInstanceundefined(OPTIONAL) Pino or Console or @bogeychan/elysia-logger instance
disableDetailsfalseDisable error details like stack
disableLogfalseDisable logging on error

Tests

To execute jest tests (all errors, type integrity test)

bun test
1.1.1

30 days ago

1.1.0

1 month ago

1.0.13

2 months ago

1.0.12

2 months ago

1.0.11

2 months ago

1.0.10

2 months ago

1.0.9

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.2

2 months ago

1.0.4

2 months ago

1.0.3

2 months ago

1.0.1

3 months ago

1.0.0

3 months ago