Skip to content

Releases: n1ru4l/envelop

December 22, 2022

22 Dec 10:49
e430ff6
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

  • #1598 21a758de Thanks @n1ru4l! - Include the validation rule names within the operation cache key.

    This prevents skipping conditional validation rules in other plugins.
    Please make sure your validation rules always have a unique name property.

November 28, 2022

28 Nov 09:38
8291991
Compare
Choose a tag to compare

@envelop/[email protected]

Major Changes

  • #1583 f6361e86 Thanks @n1ru4l! - Remove trackResolvers functionality.

    This feature resulted in errors being reported multiple times.
    In the future we might re-add it as a standalone plugin, right now we don't see any benefit from it.

Patch Changes

November 24, 2022

24 Nov 09:08
9bb352e
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

  • #1587 e2ff77ed Thanks @enisdenjo! - Don't use Id TypeScript generic utility that can cause a circular constraint error

November 15, 2022

15 Nov 14:08
890cd9a
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

October 27, 2022

27 Oct 22:31
a11a876
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

October 17, 2022

17 Oct 08:49
f1593bf
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

@envelop/[email protected]

Patch Changes

October 12, 2022

12 Oct 16:49
8d671ed
Compare
Choose a tag to compare

@envelop/[email protected]

Major Changes

  • #1487 dc1e24b5 Thanks @saihaj! - Remove isIntrospectionQuery utility

  • #1487 dc1e24b5 Thanks @saihaj! - Remove async schema loading plugin. This was a mistake from beginning as we cannot asynchronously validate and parse since with GraphQL.js are synchronous in nature.

  • #1487 dc1e24b5 Thanks @saihaj! - Remove onResolverCalled

    We decided to drop onResolverCalled hook and instead provide a new plugin that will let you hook into this phase.

    import { parse, validate, execute, subscribe } from 'graphql'
    import { envelop, Plugin, useEngine } from '@envelop/core'
    + import { useOnResolve } from '@envelop/on-resolve'
    
    import { onResolverCalled } from './my-resolver'
    
    function useResolve(): Plugin {
      return {
    -   onResolverCalled: onResolverCalled,
    +   onPluginInit: ({ addPlugin }) => {
    +     addPlugin(useOnResolve(onResolverCalled))
    +   },
      }
    }
    
    const getEnveloped = envelop({
      plugins: [
        useEngine({ parse, validate, execute, subscribe }),
        // ... other plugins ...
        useResolve(),
      ],
    });
  • #1487 dc1e24b5 Thanks @saihaj! - Drop useTiming plugin

    This plugin was dependent on tracing the schema. As we no longer support wrap the schema out of the box we decided to drop this plugin.

  • #1487 dc1e24b5 Thanks @saihaj! - Remove isIntrospectionDocument utility

  • #1487 dc1e24b5 Thanks @saihaj! - Drop Node v12 support

    Node.js v12 is no longer supported by the Node.js team. https://github.com/nodejs/Release/#end-of-life-releases

  • #1487 dc1e24b5 Thanks @saihaj! - Drop EnvelopError class

    To keep the core agnostic from a specific implementation we no longer provide the EnvelopError class.

  • #1487 dc1e24b5 Thanks @saihaj! - Remove useAsyncSchema plugin

    This was a mistake from beginning as we cannot asynchronously validate and parse since with graphql these functions are synchronous in nature.

  • #1487 dc1e24b5 Thanks @saihaj! - Remove graphql as a peer dependency

    We have built the new envelop to be engine agnostic. graphql-js is no longer a peer dependency. Now you can use any spec compliant GraphQL engine with envelop and get the benefit of building a plugin system. We have introduced a new plugin that can be used to customize the GraphQL Engine.

    - import { envelop } from '@envelop/core'
    + import { envelop, useEngine } from '@envelop/core'
    + import { parse, validate, execute, subscribe } from 'graphql';
    
    - const getEnveloped = envelop([ ... ])
    + const getEnveloped = envelop({ plugins: [useEngine({ parse, validate, execute, subscribe })] })
    

    Checkout the migration guide for more details.

  • #1487 dc1e24b5 Thanks @saihaj! - Rename useLazyLoadedSchema to useSchemaByContext since the original name was vert misleading.

  • #1487 dc1e24b5 Thanks @saihaj! - Remove enableIf utility in favor of more type safe way to conditionally enable plugins. It wasn't a great experience to have a utility

    We can easily replace usage like this:

    - import { envelop, useMaskedErrors, enableIf } from '@envelop/core'
    + import { envelop, useMaskedErrors } from '@envelop/core'
    import { parse, validate, execute, subscribe } from 'graphql'
    
    const isProd = process.env.NODE_ENV === 'production'
    
    const getEnveloped = envelop({
      parse,
      validate,
      execute,
      subscribe,
      plugins: [
        // This plugin is enabled only in production
    -    enableIf(isProd, useMaskedErrors())
    +    isProd && useMaskedErrors()
      ]
    })
  • #1487 dc1e24b5 Thanks @saihaj! - Remove handleValidationErrors and handleParseErrors options from useMaskedErrors.

    ONLY masking validation errors OR ONLY disabling introspection errors does not make sense, as both can be abused for reverse-engineering the GraphQL schema (see https://github.com/nikitastupin/clairvoyance for reverse-engineering the schema based on validation error suggestions).
    #1482 (comment)

    Rename formatError function option to maskError

  • #1487 dc1e24b5 Thanks @saihaj! - Removed orchestrator tracing

    GraphQLSchema was wrapped to provide resolvers/fields tracing from the schema. Issue with this approach was it was very specific to the underlying engine's implementation. With the new version we no longer want to depend to a specific implementation. Now users can wrap their schemas and add tracing themselves.

Minor Changes

  • #1487 dc1e24b5 Thanks @saihaj! - respond to context, parse and validate errors in useErrorHandler plugin

@envelop/[email protected]

Major Changes

@envelop/[email protected]

Major Changes

Read more

September 28, 2022

28 Sep 13:32
ae4a145
Compare
Choose a tag to compare

@envelop/[email protected]

Minor Changes

  • #1528 50f214a2 Thanks @{! - give access to execute args in validateUser function.

    This is useful in conjunction with the fieldAuthExtension parameter to achieve custom per field validation:

    import { ValidateUserFn } from '@envelop/generic-auth'
    
    const validateUser: ValidateUserFn<UserType> = async ({ user, executionArgs, fieldAuthExtension }) => {
      if (!user) {
        throw new Error(`Unauthenticated!`)
      }
    
      // You have access to the object define in the resolver tree, allowing to define any custom logic you want.
      const validate = fieldAuthExtension?.validate
      if (validate) {
        await validate({ user, variables: executionArgs.variableValues, context: executionArgs.contextValue })
      }
    }
    
    const resolvers = {
      Query: {
    
          resolve: (_, { userId }) => getUser(userId),
          extensions: {
            auth: {
              validate: ({ user, variables, context }) => {
                // We can now have access to the operation and variables to decide if the user can execute the query
                if (user.id !== variables.userId) {
                  throw new Error(`Unauthorized`)
                }
              }
            }
          }
        }
      }
    }

September 19, 2022

19 Sep 08:21
95d7b89
Compare
Choose a tag to compare

@envelop/[email protected]

Patch Changes

August 31, 2022

31 Aug 11:14
cea2df2
Compare
Choose a tag to compare

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }

Patch Changes

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [1f7af02b, ae7bc9a3]:

@envelop/[email protected]

Minor Changes

  • #1499 1f7af02b Thanks @viniciuspalma! - Adding tslib to package dependencies

    Projects that currently are using yarn Berry with PnP or any strict dependency
    resolver, that requires that all dependencies are specified on
    package.json otherwise it would endue in an error if not treated correct

    Since https://www.typescriptlang.org/tsconfig#importHelpers is currently
    being used, tslib should be exported as a dependency to external runners
    get the proper import.

    Change on each package:

    // package.json
    {
      "dependencies": {
        "tslib": "^2.4.0"
      }
    }
  • Updated dependencies [[1f7af02b](https://github.com/n1ru4l/envel...

Read more