-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: non-breaking GraphQL Engine * feat: make envelop take in engine functions * structural typings * remove grapqhl as peer dep from types pkg * make core more agnostic * chore(dependencies): updated changesets for modified dependencies * remove traced schema * remove traced orchestrator * make plugin agnostic * drop EnvelopError * remove more graphql import * Drop useTiming * make core completely free of graphql-js * add eslint rule * eslint disallow in types too * more agnostic packages * remove introspection util * chore(dependencies): updated changesets for modified dependencies * prettier * TEMP: make bot calm down * update all docs * test matrix for core * experimenting traced schema (#1501) * experimenting traced schema * Fix * remove comment * do optional chaining since we are not strongly typing * document * cleanup Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> * feat: drop node 12 (#1505) * feat: remove `enableIf` utility (#1504) * feat: remove enableIf utility * make types happpy * make types happy * add changeset * feat: remove async schema plugin and rename lazy loaded schema plugin (#1506) * remove useAsyncSchema * rename to useSchemaByContext * add eslint rule (#1509) * feat: `@envelop/on-resolve` plugin for hooking into schema resolvers (#1500) * on resolve plugin * changeset * no more onResolverCalled * unused import * args is a record * integrate and useOnResolve * resolversHooksSymbol does not exist * plugincontext for OnPluginInit * on-resolve uses addPlugin * onresolvercalled is no more * refactor for new on-resolve * fix open-telemetry tests * fix newrelic * opentelemetry graphql as peer dep * tests * addPlugin doesnt need to be used * reorder * respects onPluginInit context * drop unused import * fixes false positive eslint warnings Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com> * docs: order of plugins matter (#1513) * feat: remove handler for validation and parse errors (#1510) * feat: remove hanlder for validation and parse errors * tests * make it work * Add docs * Fix serialization issue * Go * .. * update docs * update test * make it work * feat: add originalError in dev mode (#1514) * remove Fn appendix * name graphql error * make ts happy * make toJSON required Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: Laurin Quast <laurinquast@googlemail.com> * add changeset * Update .changeset/nervous-seas-own.md * Update .changeset/rude-cats-peel.md * no-use-before-define (#1522) * feat: trigger on context, validate and parse errors (#1511) * feat: trigger on context, validate and parse errors * trying * make it work * pass in phase * add phase details * feedback * docs: migration guide (#1520) * docs: migration guide * remove slashes * Update website/docs/guides/migrating-from-v2-to-v3.mdx Co-authored-by: Denis Badurina <badurinadenis@gmail.com> * feedback * document removing of orchestrated tracer * more feedback * update docs * update examples * async schema example Co-authored-by: Denis Badurina <badurinadenis@gmail.com> * Add redirects * remove deafult skip error from sentry plugin * export masked error plugin * sentry plugin default skip GraphQLError * sentry: og error is not graphql error then send to sentry * doc: drop introspection utils * should fix ts issues on v15 * test: stack error we should not match the error name since it can be different across impl * feat: use engine plugin (#1535) * feat: use engine plugin * remove assertion * make useEngine plugin the only way to pass engine functions (#1536) * make useEngine plugin the only way to pass engine fns * update types * update docs * Update packages/plugins/apollo-datasources/README.md Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> * prettier: Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> * fix * versioned docs with v3 default * fix build * fix * feat this is cool * docs reword schema tracing * docs add graphql error example * docs restructuring, fix typos * chore remove autogenerated changeset * cleanup changeset * docs sycn patch Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: Denis Badurina <denis@domonda.com> Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com> Co-authored-by: Laurin Quast <laurinquast@googlemail.com> Co-authored-by: Denis Badurina <badurinadenis@gmail.com>
- Loading branch information
1 parent
8b3c369
commit dc1e24b
Showing
183 changed files
with
6,797 additions
and
1,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## Remove `isIntrospectionQuery` utility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
'@envelop/core': major | ||
'@envelop/on-resolve': major | ||
--- | ||
|
||
## Remove `onResolverCalled` | ||
|
||
We decided to drop onResolverCalled hook and instead [provide a new plugin](https://github.com/n1ru4l/envelop/pull/1500) that will let you hook into this phase. | ||
|
||
```diff | ||
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(), | ||
], | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/sentry': major | ||
--- | ||
|
||
Default skip reporting `GraphQLError` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## Remove `isIntrospectionDocument` utility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## Drop `EnvelopError` class | ||
|
||
To keep the core agnostic from a specific implementation we no longer provide the `EnvelopError` class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## Remove `useAsyncSchema` plugin | ||
|
||
This was a mistake from beginning as we cannot asynchronously validate and parse since with [graphql](https://github.com/graphql/graphql-js) these functions are synchronous in nature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## 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. | ||
|
||
```diff | ||
- 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](https://www.the-guild.dev/graphql/envelop/v3/guides/migrating-from-v2-to-v3) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## Rename `useLazyLoadedSchema` to `useSchemaByContext` since the original name was vert misleading. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
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: | ||
|
||
```diff | ||
- 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() | ||
] | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
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). | ||
> https://github.com/n1ru4l/envelop/issues/1482#issue-1340015060 | ||
Rename `formatError` function option to `maskError` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@envelop/core': minor | ||
--- | ||
|
||
respond to context, parse and validate errors in `useErrorHandler` plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@envelop/core': major | ||
--- | ||
|
||
## 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.