@graphql-tools/mock
9.0.25
Patch Changes
- Updated dependencies
[
32d0457]:- @graphql-tools/utils@10.9.1
- @graphql-tools/schema@10.0.25
9.0.24
Patch Changes
-
#7272
803288cThanks @XiNiHa ! - Remove unneeded toString in MockStore -
Updated dependencies [
22af985,53db005]:- @graphql-tools/utils@10.9.0
- @graphql-tools/schema@10.0.24
9.0.23
Patch Changes
- #7210
2443c23Thanks @jdolle ! - preserveResolvers uses resolved type name for abstract types if available
9.0.22
Patch Changes
-
6d69edeThanks @ardatan ! - Fix prototype polluting assignment -
Updated dependencies [
d123e26]:- @graphql-tools/utils@10.8.6
- @graphql-tools/schema@10.0.23
9.0.21
Patch Changes
-
#7026
ece7732Thanks @ardatan ! - Prevent prototype polluting assignment -
Updated dependencies [
90a717e,26518de]:- @graphql-tools/utils@10.8.5
- @graphql-tools/schema@10.0.22
9.0.20
Patch Changes
- Updated dependencies
[
155944b]:- @graphql-tools/utils@10.8.4
- @graphql-tools/schema@10.0.21
9.0.19
Patch Changes
- Updated dependencies
[
4a2eb14]:- @graphql-tools/utils@10.8.3
- @graphql-tools/schema@10.0.20
9.0.18
Patch Changes
- Updated dependencies
[
3547bba]:- @graphql-tools/utils@10.8.2
- @graphql-tools/schema@10.0.19
9.0.17
Patch Changes
- Updated dependencies
[
651a5dc]:- @graphql-tools/utils@10.8.1
- @graphql-tools/schema@10.0.18
9.0.16
Patch Changes
- Updated dependencies
[
357b2ee,0a3e193,357b2ee]:- @graphql-tools/schema@10.0.17
- @graphql-tools/utils@10.8.0
9.0.15
Patch Changes
9.0.14
Patch Changes
9.0.13
Patch Changes
- Updated dependencies
[
4912f19]:- @graphql-tools/utils@10.7.1
- @graphql-tools/schema@10.0.15
9.0.12
Patch Changes
- Updated dependencies
[
2c70d27]:- @graphql-tools/utils@10.7.0
- @graphql-tools/schema@10.0.14
9.0.11
Patch Changes
- Updated dependencies
[
6a8123b]:- @graphql-tools/utils@10.6.4
- @graphql-tools/schema@10.0.13
9.0.10
Patch Changes
-
020b9e4Thanks @ardatan ! - `AbortSignal` in `GraphQLResolveInfo`, and `AbortSignal` in `ExecutionRequest` -
Updated dependencies [
020b9e4]:- @graphql-tools/schema@10.0.12
- @graphql-tools/utils@10.6.3
9.0.9
Patch Changes
- #6662
696a0d5Thanks @renovate ! - dependencies updates:- Updated dependency
@graphql-tools/schema@^10.0.10↗︎ (from^10.0.9, independencies) - Updated dependency
@graphql-tools/utils@^10.6.1↗︎ (from^10.6.0, independencies)
- Updated dependency
- Updated dependencies
[
696a0d5,1b24656]:- @graphql-tools/schema@10.0.11
- @graphql-tools/utils@10.6.2
9.0.8
Patch Changes
- Updated dependencies
[
1e02935]:- @graphql-tools/utils@10.6.1
- @graphql-tools/schema@10.0.10
9.0.7
Patch Changes
- Updated dependencies
[
414e404]:- @graphql-tools/utils@10.6.0
- @graphql-tools/schema@10.0.9
9.0.6
Patch Changes
- Updated dependencies
[
dc5043b]:- @graphql-tools/utils@10.5.6
- @graphql-tools/schema@10.0.8
9.0.5
Patch Changes
- Updated dependencies
[
cf2ce5e]:- @graphql-tools/utils@10.5.5
- @graphql-tools/schema@10.0.7
9.0.4
Patch Changes
- #6265
ca61aa0Thanks @snstanton ! - fix errors in find and filter with an empty store
9.0.3
Patch Changes
-
#6201
9d79b3eThanks @grxy ! - perf: only clone schema once inaddMocksToSchema -
Updated dependencies [
7368829,e10c13a]:- @graphql-tools/schema@10.0.4
- @graphql-tools/utils@10.2.1
9.0.2
Patch Changes
- #5913
83c0af0Thanks @enisdenjo ! - dependencies updates:- Updated dependency
@graphql-tools/schema@^10.0.2↗︎ (from^10.0.0, independencies)
- Updated dependency
- Updated dependencies
[
83c0af0]:- @graphql-tools/schema@10.0.3
9.0.1
Patch Changes
-
#5730
694d540Thanks @zyzo ! - Pass fieldArgs to value function -
Updated dependencies [
f85c093]:- @graphql-tools/utils@10.0.13
9.0.0
Major Changes
Patch Changes
8.7.20
Patch Changes
-
1c95368aThanks @ardatan ! - Use ranged versions for dependencies -
Updated dependencies [
1c95368a]:- @graphql-tools/schema@9.0.18
8.7.19
Patch Changes
- Updated dependencies []:
- @graphql-tools/schema@9.0.17
8.7.18
Patch Changes
- Updated dependencies
[
b5c8f640]:- @graphql-tools/utils@9.2.1
- @graphql-tools/schema@9.0.16
8.7.17
Patch Changes
8.7.16
Patch Changes
- Updated dependencies []:
- @graphql-tools/schema@9.0.14
8.7.15
Patch Changes
8.7.14
Patch Changes
- Updated dependencies
[
904fe770]:- @graphql-tools/utils@9.1.3
- @graphql-tools/schema@9.0.12
8.7.13
Patch Changes
- Updated dependencies
[
13c24883]:- @graphql-tools/utils@9.1.2
- @graphql-tools/schema@9.0.11
8.7.12
Patch Changes
- Updated dependencies
[
7411a5e7]:- @graphql-tools/utils@9.1.1
- @graphql-tools/schema@9.0.10
8.7.11
Patch Changes
- Updated dependencies
[
c0639dd0]:- @graphql-tools/utils@9.1.0
- @graphql-tools/schema@9.0.9
8.7.10
Patch Changes
- Updated dependencies
[
d83b1960]:- @graphql-tools/utils@9.0.1
- @graphql-tools/schema@9.0.8
8.7.9
Patch Changes
- Updated dependencies
[
80836fa7,8f6d3efc,80836fa7,80836fa7,80836fa7]:- @graphql-tools/utils@9.0.0
- @graphql-tools/schema@9.0.7
8.7.8
Patch Changes
- Updated dependencies
[
f7daf777]:- @graphql-tools/utils@8.13.1
- @graphql-tools/schema@9.0.6
8.7.7
Patch Changes
- Updated dependencies
[
df5848b8,df5848b8,df5848b8]:- @graphql-tools/utils@8.13.0
- @graphql-tools/schema@9.0.5
8.7.6
Patch Changes
- Updated dependencies
[
43c736bd]:- @graphql-tools/utils@8.12.0
- @graphql-tools/schema@9.0.4
8.7.5
Patch Changes
8.7.4
Patch Changes
- Updated dependencies
[
4fe3d9c0]:- @graphql-tools/utils@8.10.1
- @graphql-tools/schema@9.0.2
8.7.3
Patch Changes
- Updated dependencies
[
2609d71f]:- @graphql-tools/utils@8.10.0
- @graphql-tools/schema@9.0.1
8.7.2
Patch Changes
-
#4624
e3167edcThanks @n1ru4l ! - Fix CommonJS TypeScript resolution withmoduleResolutionnode16ornodenext -
Updated dependencies [
8cc8721f,e3167edc]:- @graphql-tools/schema@9.0.0
- @graphql-tools/utils@8.9.1
8.7.1
Patch Changes
- Updated dependencies [2a3b45e3]
- @graphql-tools/utils@8.9.0
- @graphql-tools/schema@8.5.1
8.7.0
Minor Changes
- d76a299c: Support TypeScript module resolution.
Patch Changes
- Updated dependencies [a0abbbcd]
- Updated dependencies [d76a299c]
- @graphql-tools/utils@8.8.0
- @graphql-tools/schema@8.5.0
8.6.13
Patch Changes
- Updated dependencies [4914970b]
- @graphql-tools/schema@8.4.0
- @graphql-tools/utils@8.7.0
8.6.12
Patch Changes
- 041c5ba1: Use caret range for the tslib dependency
- Updated dependencies [041c5ba1]
- @graphql-tools/schema@8.3.14
- @graphql-tools/utils@8.6.13
8.6.11
Patch Changes
- Updated dependencies [da7ad43b]
- @graphql-tools/utils@8.6.12
- @graphql-tools/schema@8.3.13
8.6.10
Patch Changes
- Updated dependencies [c0762ee3]
- @graphql-tools/utils@8.6.11
- @graphql-tools/schema@8.3.12
8.6.9
Patch Changes
- Updated dependencies [0fc510cb]
- @graphql-tools/utils@8.6.10
- @graphql-tools/schema@8.3.11
8.6.8
Patch Changes
- Updated dependencies [31a33e2b]
- @graphql-tools/utils@8.6.9
- @graphql-tools/schema@8.3.10
8.6.7
Patch Changes
- Updated dependencies [cb238877]
- @graphql-tools/utils@8.6.8
- @graphql-tools/schema@8.3.9
8.6.6
Patch Changes
- Updated dependencies [0bbb1769]
- @graphql-tools/utils@8.6.7
- @graphql-tools/schema@8.3.8
8.6.5
Patch Changes
- Updated dependencies [904c0847]
- @graphql-tools/utils@8.6.6
- @graphql-tools/schema@8.3.7
8.6.4
Patch Changes
- Updated dependencies [722abad7]
- @graphql-tools/schema@8.3.6
8.6.3
Patch Changes
- Updated dependencies [be2c02d7]
- @graphql-tools/utils@8.6.5
- @graphql-tools/schema@8.3.5
8.6.2
Patch Changes
- Updated dependencies [d36d530b]
- @graphql-tools/utils@8.6.4
- @graphql-tools/schema@8.3.4
8.6.1
Patch Changes
- 0c0c6857: fix - align versions
- Updated dependencies [0c0c6857]
- @graphql-tools/schema@8.3.3
8.6.0
Minor Changes
- 7dcf3d9a: feat(mock): ability to add typesafety to IMocks with custom resolver signature
8.5.3
Patch Changes
- 72e073f5: Resolve an issue with addMocksToSchema where the provided store is ignored
8.5.2
Patch Changes
- 18341363: feat(visitResult): ignore if field not present in visited object
- Updated dependencies [18341363]
- @graphql-tools/schema@8.3.2
- @graphql-tools/utils@8.6.2
8.5.1
Patch Changes
- 9c03ac88: Resolve an issue with custom scalar mocks being ignored in deep mocking when preserveResolvers option is turned on.
- Updated dependencies [69b316c2]
- @graphql-tools/utils@8.6.0
8.5.0
Minor Changes
- e6e9f91f: Added relayStylePaginationMock helper
8.4.4
Patch Changes
- 3eef5e2e: Update deep mocking feature with preserveResolvers for more scenarios
8.4.3
Patch Changes
- dc7c9984: fix(mock): allow mocking of objects nested in arrays
8.4.2
Patch Changes
- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/schema@8.3.1
- @graphql-tools/utils@8.5.1
8.4.1
Patch Changes
- 99319bea: fix(mock): MockStore.has should be true if key is present without data
8.4.0
Minor Changes
- d7de7fb6: feat(mock): add has method to MockStore
Patch Changes
- Updated dependencies [da157d62]
- @graphql-tools/utils@8.2.3
8.3.1
Patch Changes
- 491e961a: fix(mock): fix handling _id field name
8.3.0
Minor Changes
- c5b0719c: feat: GraphQL v16 support
Patch Changes
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- @graphql-tools/utils@8.2.0
- @graphql-tools/schema@8.2.0
8.2.2
Patch Changes
- e50852e6: use version ranges instead of a fixed version for the graphql-tools package versions
- Updated dependencies [e50852e6]
- @graphql-tools/schema@8.1.2
8.2.1
Patch Changes
- Updated dependencies [2c807ddb]
- @graphql-tools/utils@8.1.1
- @graphql-tools/schema@8.1.1
8.2.0
Minor Changes
- 9a445940: feat(mock): add
findandfiltermethods
Patch Changes
- Updated dependencies [b9684631]
- Updated dependencies [9ede806a]
- Updated dependencies [67691b78]
- @graphql-tools/utils@8.1.0
- @graphql-tools/schema@8.1.0
8.1.8
Patch Changes
- Updated dependencies [4992b472]
- @graphql-tools/merge@7.0.0
- @graphql-tools/schema@8.0.3
8.1.7
Patch Changes
- Updated dependencies [04830049]
- @graphql-tools/utils@8.0.2
- @graphql-tools/merge@6.2.17
- @graphql-tools/schema@8.0.2
8.1.6
Patch Changes
- Updated dependencies [b823dbaf]
- @graphql-tools/utils@8.0.1
- @graphql-tools/merge@6.2.16
- @graphql-tools/schema@8.0.1
8.1.5
Patch Changes
- e7b78fd5: Removes
ts-is-defineddependency
8.1.4
Patch Changes
- 50be3974: Safer use of Object.prototype.hasOwnProperty #3069
- Updated dependencies [af9a78de]
- Updated dependencies [9c26b847]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [dae6dc7b]
- Updated dependencies [6877b913]
- Updated dependencies [7d3e3006]
- Updated dependencies [c42e811d]
- Updated dependencies [7d3e3006]
- Updated dependencies [8c8d4fc0]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [74581cf3]
- Updated dependencies [c0ca3190]
- Updated dependencies [7d3e3006]
- Updated dependencies [982c8f53]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [a31f9593]
- Updated dependencies [7d3e3006]
- @graphql-tools/utils@8.0.0
- @graphql-tools/schema@8.0.0
- @graphql-tools/merge@6.2.15
8.1.3
Patch Changes
- 702f44ec: Avoid
__typename does not existerror
8.1.2
Patch Changes
- 8e644923: fix(mock): handle null values correctly
8.1.1
Patch Changes
- cf794a42: fix(mock): fix missing reset method to IMockStore
8.1.0
Minor Changes
- a2e7ff77: feat(mock): add reset method to MockStore
8.0.0
Major Changes
-
24926654: Reworked to add state-full behavior to the library:
- Breaking: mock functions does not receive resolver arguments anymore and can’t return promise.
Use
resolversoption instead. - Breaking: when preserved, resolvers will not receive plain object returned by mock anymore as
source but rather a
Refthat can be used to query the store. - Deprecated: MockList is deprecated. Use plain arrays instead.
See migration guide .
- Breaking: mock functions does not receive resolver arguments anymore and can’t return promise.
Use
7.0.0
Major Changes
-
be1a1575: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema)-
Resolver validation options should now be set to
error,warnorignorerather thantrueorfalse. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior. -
The
allowResolversNotInSchemahas been renamed torequireResolversToMatchSchema, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchemaiserror, matching the previous behavior.
Schema Delegation (
delegateToSchema&@graphql-tools/delegate)-
The
delegateToSchemareturn value has matured and been formalized as anExternalObject, in which all errors are integrated into the GraphQL response, preserving their initial path. Those advanced users accessing the result directly will note the change in error handling. This also allows for the deprecation of unnecessary helper functions includingslicedError,getErrors,getErrorsByPathSegmentfunctions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrorsfunction is therefore necessary for retrieving only these errors. Note also the newannotateExternalObjectandmergeExternalObjectsfunctions, as well as the renaming ofhandleResulttoresolveExternalValue. -
Transform types and the
applySchemaTransformsare now relocated to thedelegatepackage;applyRequestTransforms/applyResultTransformsfunctions have been deprecated, however, as this functionality has been replaced since v6 by theTransformerabstraction. -
The
transformRequest/transformResultmethods are now provided additionaldelegationContextandtransformationContextarguments — these were introduced in v6, but previously optional. -
The
transformSchemamethod may wish to create additional delegating resolvers and so it is now provided thesubschemaConfigand final (non-executable)transformedSchemaparameters. As in v6, thetransformSchemais kicked off once to produce the non-executable version, and then, if a wrapping schema is being generated, proxying resolvers are created with access to the (non-executable) initial result. In v7, the individualtransformSchemamethods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers. -
applySchemaTransformsparameters have been updated to match and support thetransformSchemaparameters above.
Remote Schemas & Wrapping (
wrapSchema,makeRemoteExecutableSchema, and@graphql-tools/wrap)-
wrapSchemaandgenerateProxyingResolversnow only take a single options argument with named properties of typeSubschemaConfig. The previously possible shorthand version with first argument consisting of aGraphQLSchemaand second argument representing the transforms should be reworked as aSubschemaConfigobject. -
Similarly, the
ICreateProxyingResolverOptionsinterface that provides the options for thecreateProxyingResolverproperty ofSubschemaConfigoptions has been adjusted. Theschemaproperty previously could be set to aGraphQLSchemaor aSubschemaConfigobject. This property has been removed in favor of asubschemaConfigproperty that will always be aSubschemaConfigobject. Thetransformsproperty has been removed; transforms should be included within theSubschemaConfigobject.` -
The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either
defaultMergedResolveror a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throughtcreateMergedResolverhas been deprecated, as custom merging resolvers conflicts when using stitching’s type merging, where resolvers are expected to be identical across subschemas. -
The
WrapFieldstransform’swrappingResolveroption has been removed, as this complicates multiple wrapping layers, as well as planned functionality to wrap subscription root fields in potentially multiple layers, as the wrapping resolvers may be different in different layers. Modifying resolvers can still be performed by use of an additional transform such asTransformRootFieldsorTransformObjectFields. -
The
ExtendSchematransform has been removed, as it is conceptually simpler just to usestitchSchemaswith one subschema. -
The
ReplaceFieldsWithFragment,AddFragmentsByField,AddSelectionSetsByField, andAddMergedTypeSelectionSetstransforms has been removed, as they are superseded by theAddSelectionSetsandVisitSelectionSetstransforms. TheAddSelectionSetspurposely takes parsed SDL rather than strings, to nudge end users to parse these strings at build time (when possible), rather than at runtime. Parsing of selection set strings can be performed using theparseSelectionSetfunction from@graphql-tools/utils.
Schema Stitching (
stitchSchemas&@graphql-tools/stitch)-
stitchSchemas’smergeTypesoption is now true by default! This causes theonTypeConflictoption to be ignored by default. To useonTypeConflictto select a specific type instead of simply merging, simply setmergeTypesto false. -
schemasargument has been deprecated, usesubschemas,typeDefs, ortypes, depending on what you are stitching. -
When using batch delegation in type merging, the
argsFromKeysfunction is now set only via theargsFromKeysproperty. Previously, ifargsFromKeyswas absent, it could be read fromargs. -
Support for fragment hints has been removed in favor of selection set hints.
-
stitchSchemasnow processes allGraphQLSchemaandSubschemaConfigsubschema input into newSubschemaobjects, handling schema config directives such aso@computedas well as generating the final transformed schema, stored as thetransformedSchemaproperty, if transforms are used. Signatures of theonTypeConflict,fieldConfigMerger, andinputFieldConfigMergerhave been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflictfromschematosubschema.
Mocking (
addMocksToSchemaand@graphql-tools/mock)- Mocks returning objects with fields set as functions are now operating according to upstream
graphql-js convention, i.e. these functions take three arguments,
args,context, andinfowithparentavailable asthisrather than as the first argument.
Other Utilities (
@graphql-tools/utils)filterSchema’sfieldFilterwill now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilteroption.- Unused
fieldNodesutility functions have been removed. - Unused
typeContainsSelectionSetfunction has been removed, andtypesContainSelectionSethas been moved to thestitchpackage. - Unnecessary
Operationtype has been removed in favor ofOperationTypeNodefrom upstream graphql-js. - As above,
applySchemaTransforms/applyRequestTransforms/applyResultTransformshave been removed from theutilspackage, as they are implemented elsewhere or no longer necessary.
Related Issues
- proxy all the errors: #1047, #1641
- better error handling for merges #2016, #2062
- fix typings #1614
- disable implicit schema pruning #1817
- mocks not working for functions #1807
-
Patch Changes
- Updated dependencies [be1a1575]
- @graphql-tools/schema@7.0.0
- @graphql-tools/utils@7.0.0
6.2.4
Patch Changes
- 533d6d53: Bump all packages to allow adjustments
- Updated dependencies [32c3c4f8]
- Updated dependencies [533d6d53]
- @graphql-tools/utils@6.2.4
- @graphql-tools/schema@6.2.4