Major Changes
-
af9a78d: BREAKING CHANGE
-
Now each loader handles glob patterns internally and returns an array of
Source
object instead of singleSource
-
GraphQL Tag Pluck now respects code locations and returns graphql-js
Source
objects for each found code block -
Thanks to the one above,
CodeFileLoader
now returns differentSource
objects for each found SDL code block.
-
-
7d3e300: BREAKING CHANGE
- Remove
fieldToFieldConfig
,argsToFieldConfigArgument
andargumentToArgumentConfig
-
- You can use
.toConfig
method instead for each.
- You can use
- Remove
-
7d3e300: BREAKING CHANGE
- Legacy Schema Directives and Directive Resolvers have been removed
-
- You can check the new method for both;
-
dae6dc7: refactor: ExecutionParams type replaced by Request type
rootValue property is now a part of the Request type.
When delegating with delegateToSchema, rootValue can be set multiple ways:
- when using a custom executor, the custom executor can utilize a rootValue in whichever custom way it specifies.
- when using the default executor (execute/subscribe from graphql-js):
-- rootValue can be passed to delegateToSchema via a named option
-- rootValue can be included within a subschemaConfig
-- otherwise, rootValue is inferred from the originating schema
When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver function which can pass whatever rootValue it wants to delegateToSchema as above.
-
6877b91: BREAKING CHANGES;
mergeDeep
now takes an array of sources instead of set of parameters as input and it takes an additional flag to enable prototype merging
Instead ofmergeDeep(...sources)
=>mergeDeep(sources)
-
c42e811: BREAKING CHANGES;
- Rename
Request
toExecutionRequest
- Add required
operationType: OperationTypeNode
field inExecutionRequest
- Add
context
increateRequest
andcreateRequestInfo
instead ofdelegateToSchema
It doesn't rely on info.operation.operationType to allow the user to call an operation from different root type.
And it doesn't call getOperationAST again and again to get operation type from the document/operation because we have it in Request and ExecutionParams
https://github.com/ardatan/graphql-tools/pull/3166/files#diff-d4824895ea613dcc1f710c3ac82e952fe0ca12391b671f70d9f2d90d5656fdceR38Improvements;
- Memoize
defaultExecutor
for a singleGraphQLSchema
so allowgetBatchingExecutor
to memoizebatchingExecutor
correctly. - And there is no different
defaultExecutor
is created forsubscription
and other operation types. Only one executor is used.
Batch executor is memoized by
executor
reference butcreateDefaultExecutor
didn't memoize the default executor so this memoization wasn't working correctly onbatch-execute
side.
https://github.com/ardatan/graphql-tools/blob/remove-info-executor/packages/batch-execute/src/getBatchingExecutor.ts#L9 - Rename
-
7d3e300: BREAKING CHANGE
- Now it uses the native
AggregateError
implementation. The major difference is the individual errors are kept undererrors
property instead of the object itself withSymbol.iterator
.
// From; for (const error of aggregateError) // To; for (const error of aggregateError.errors)
- Now it uses the native
-
8c8d4fc: BREAKING CHANGE: remove cloneSchema
-
7d3e300: BREAKING CHANGE
- No longer exports
debugLog
but usesconsole.log
directly only ifDEBUG
is available underprocess.env
- No longer exports
-
7d3e300: BREAKING CHANGE
- No longer applies
camelCase
naming convention inbuildOperationNodeForField
- No longer applies
-
74581cf: fix(getDirectives): preserve order around repeatable directives
BREAKING CHANGE: getDirectives now always return an array of individual DirectiveAnnotation objects consisting of
name
andargs
properties.New useful function
getDirective
returns an array of objects representing any args for each use of a single directive (returning the empty object{}
when a directive is used without arguments).Note: The
getDirective
function returns an array even when the specified directive is non-repeatable. This is because one use of this function is to throw an error if more than one directive annotation is used for a non repeatable directive!When specifying directives in extensions, one can use either the old or new format.
-
c0ca319: BREAKING CHANGE
- Remove Subscriber and use only Executor
-
- Now
Executor
can receiveAsyncIterable
and subscriptions will also be handled byExecutor
. This is a future-proof change for defer, stream and live queries
- Now
-
7d3e300: BREAKING CHANGE
- No longer exports
SchemaVisitor
,visitSchema
andVisitSchemaKind
-
- Use
mapSchema
instead
- Use
- No longer exports
Minor Changes
- 9c26b84: enhance(loaders): remove optional methods from the Loader interface
- 7d3e300: feat(utils): Respect operationName and rootValue in ExecutionParams
Patch Changes
- 982c8f5: enhance(utils): refactor, cleanup and remove extra work