That is a major release where we went through all issues and PRs and got the library back into great shape. All known issues with schema stitching had been fixed. The main person which did the heavy lifting is @yaacovCR which made the work alone on his own fork for many months.
- Support GraphQL v15 #1332
- Adds graphql-upload compatible scalar and link for proxying remote file uploads #671
- Add ability to merge fields from types from different schemas
- Add transforms to wrap, extract, and rename fields #1183
- Add transform to filter object fields #819
- Exports visitSchema, SchemaVisitor, healSchema, healTypes, cloneSchema, cloneType, cloneDirective to enable more custom transforms. #1070
- Allow removing extra delegation layers by passing fetcher/link options directly to delegateToSchema, mergeSchemas, and transformSchema and by filtering directly with filterSchema without additional transformation round #1165
- Support CJS and ESM #913 PR #1320 PR #1329
- Add TransformQuery transform to allow delegating to subfields with error preservation #543 PR #1307
- add WrapType transform to namespace subschema root queries (not for use with mutations) #961 #439 PR #1307
- Add HoistFields transform to hoist subfields from field to parent type #781 PR #1307
- Add ability to specify custom root type names, with new transform RenameRootTypes that allows changing a subschemas root type, a necessary transform when the subschema includes the root query type within another output type #892 PR #1307
- Add type merging, and otherwise restore onTypeConflict #1133 #1118 #1044 #863 #642 #447 PR #1307
- Expose createRequest functionality for alternative method of batching besides using links #724 PR #1307
- Provide support for GraphQLUpload scalar with schema stitching #671 PR #1307
- Let
makeRemoteExecutableSchema
,wrapSchema
,transformSchema
,mergeSchemas
to specify a custom delegating resolver #1302 - Expose
mapSchema
(which creates new schemas),visitSchema
(which modifies existing schemas),healSchema
(which visitSchema uses),toConfig
, as well as additional utility functions #1070 #922 #786 #761 PR #1307
- Avoid using internal api of
graphql-js
#1331 - Filter unused variables from map when proxying requests
- Preserve subscription errors when using makeRemoteExecutableSchema
- Preserve extensions when transforming schemas
- Fix merging and transforming of custom scalars and enums #501, #1056, #1200
- Allow renaming of subscription root fields #997, #1002
- Fix alias resolution to no longer incorrectly fallback to non-aliased field when null #1171
- Do not remove default directives (skip, include, deprecated) when not merging custom directives #1159
- Fixes errors support #743, #1037, #1046
- Fix mergeSchemas to allow resolvers to return fields defined as functions #1061
- Fix default values with mergeSchemas and addResolveFunctionsToSchema #1121
- Fix interface and union healing
- Fix stitching unions of types with enums
- Fix mocking to work when schema stitching
- Fix lost directives when adding an enum resolver
- Fix Circular Dependencies #924 PR #1326
- Fix types #1298 #1279 #837 #1307 #1325 #1324
- issues involving importing directories #1242 #1307
- fix n^2 problem within makeRemoteExecutableSchema #1346 PR #1352
- Filter
extensions
prior to passing them tobuildASTSchema
, in an effort to provide minimum compatibilty forgraphql@14
-compatible schemas with the upcominggraphql@15
release. This PR does not, however, bring support for newergraphql@15
features like interfaces implementing interfaces. #1284
- Use
getIntrospectionQuery
instead of deprecatedintrospectionQuery
constant from graphql-js @derek-miller in #1228
- Fixes a bug where schemas with scalars could not be merged when passed to
mergeSchemas
as a string orGraphQLSchema
.
@hayes in #1062 - Make
mergeSchemas
optionally merge directive definitions.
@freiksenet in #1003 - Allow user-provided
buildSchema
options.
@trevor-scheer in #1154 - Fix
delegateToSchema
to allow delegation to subscriptions with different root field names, allows the use of theRenameRootFields
transform with subscriptions, pull request #1104, fixes #997. - Add transformers to rename, filter, and arbitrarily transform object fields.
Fixes #819.
- Make
WrapQuery
work for non-root fields
@mdlavin in #1007 - Update resolvers.md to clarify array usage
@alvin777 in #1005 - Add missing property to
mergeSchemas
api reference.
@PlayMa256 in #1014 - Documentation updates for mockServer
@dougshamoo in #1012 - Fix default merged resolver behavior
@mfix22 in #983 - Use
TArgs
generic whereverIFieldResolver
is used.
@brikou in #955 - Include deprecations from string SDL in mergeSchemas.
@evans in #1041
- Replaced broken link in docs homepage with Launchpad example
@kriss1897 in #965 - Fix invalid query in schema delegation example.
@nico29 in #980 - Update package.json
repository
field.
@dlukeomalley in #979 - Add support for passing a parsed schema ast to
mergeSchemas
@ganemone in #977 - Changes to
extractExtensionDefinitions
to supportgraphql-js
union and enum extensions.
@jansuchy in #951 - Add docs for
mockServer
(closes #951)
@mfix22 in PR #982 - Fix regression where custom scalars were incorrectly replaced while recreating schema with
visitSchema
.
@tgriesser in #985
- Fix regression in enum input mapping.
@tgriesser in #974
- Fix regression in enum internal value mapping.
@tgriesser in #973
- Support
graphql
and@types/graphql
14.x.
NOTE:graphql
14 includes breaking changes. We're bumping the major version ofgraphql-tools
to accommodate those breaking changes. If you're planning on usinggraphql
14 withgraphql-tools
4.0.0, please make sure you've reviewed thegraphql
breaking changes list. @hwillson in #953 - Fix template strings usage in guessSchemaByRootField error message.
@nagelflorian in #936 - Update
IFieldResolver
to allow typed input args.
@luk3thomas in #932 - Changes to
extractExtensionDefinitions
to properly supportgraphql-js
input extensions.
@jure in #948 - Stop automatically shallow cloning (via object spread syntax) transformed subscription results. Transformed subscription results are not always objects, which means object spreading can lead to invalid results.
@ericlewis in #928 - Re-use errors with an
extensions
property to make compatible with Apollo Server and it's built-in errors.
@edorsey in #925 - Documentation updates.
@Amorites in #944
@trevor-scheer in #946
@dnalborczyk in #934
@zcei in #933
- Revert the added
casual
dependency for mocking, since it was causing issues for people usinggraphql-tools
in the browser.
- Loosens the apollo-link dependency PR #765
- Use
getDescription
fromgraphql-js
package PR #672 - Update
IResolvers
to use source & context generics and to support all resolver use cases. #896 WrapQuery
'swrapper
param can now return a SelectionSet. PR #902 Issue #901- Add null to return type of directive visitors in the TypeScript definition.
- Make sure mergeSchemas keeps Enum descriptions and deprecation status. PR 898
- Add
inheritResolversFromInterfaces
option tomergeSchemas
PR #812 - Added filtering of empty selection sets in FilterToSchema #827
- Add support for overlapping fragments in ReplaceFieldWithFragment. #894
delegateToSchema
now behaves likeinfo.mergeInfo.delegateToSchema
for fragment handling Issue #876 PR #885- Make schema transforms work with subscriptions, make it so that subscription errors don't disappear when using mergeSchemas #793 #780
- Update apollo-link to 1.2.2 #785
- Make sure
dist/generate
isn't excluded when published.
- Pass on operation name when stitching schemas. Issue #522 PR #849
- Fixed errors that occurred when a fragment field argument used a variable defined in the parent query. Issue #753 PR #806
- Fixed duplicate fragments getting added during transform in
FilterToSchema
#778 - Fixed a visitType error printing the name of the variable typeName rather than its value due to a template string being incorrectly formatted. #783
-
Fixed an array cloning bug in the
RenameTypes
transform #756 -
Fixed a fragments bug in the
ReplaceFieldWithFragment
transform #763
-
Schema transforms and delegation
- Substantial rewrite of internals of
mergeSchemas
anddelegateToSchema
- A new API for schema transforms has been introduced: Docs
delegateToSchema
is now a public API: DocsdelegateToSchema
now accepts an object of named parameters; positional arguments are deprecateddelegateToSchema
no longer acceptsfragmentReplacements
; instead usetransforms
info.mergeInfo.delegateToSchema
is now the preferred delegation API, rather thaninfo.mergeInfo.delegate
- Substantial rewrite of internals of
-
Other changes
- Allow
extend interface
definitions in merged schemas PR #703 - Fix typo in
@deprecated
example inschema-directives.md
PR #706 - Fix timezone bug in test for
@date
directive PR #686 - Expose
defaultMergedResolver
for schema stitching PR #685 - Add
requireResolversForResolveType
to resolver validation options PR #698 - Add
inheritResolversFromInterfaces
option tomakeExecutableSchema
andaddResolveFunctionsToSchema
PR #720
- The
SchemaDirectiveVisitor
abstraction for implementing reusable schema@directive
s has landed. Read our blog post about this new functionality, and/or check out the documentation for even more examples. PR #640
- When concatenating errors maintain a reference to the original for use downstream Issue #480 PR #637
- Improve generic typings for several resolver-related interfaces PR #662
- Remove copied apollo-link code PR #670
- Handle undefined path in
getErrorsFromParent
PR #667
- Make iterall a runtime dependency PR #627
- Added support for lexical parser options PR #567
- Support
graphql@^0.13.0
PR #567 - Don't use
Symbol
in incompatible envs Issue #535 PR #631
- Pass through apollo-link-http errors to originalError PR #621
- Fix
error.path
could beundefined
for schema stitching PR #617
- Recreate enums and scalars for more consistent behaviour of merged schemas PR #613
makeExecutableSchema
andmergeSchema
now accept an array ofIResolver
PR #612 PR #576 PR #577- Fix
delegateToSchema.ts
to remove duplicate new variable definitions when delegating to schemas PR #607 - Fix duplicate subscriptions for schema stitching PR #609
- Also recreate
astNode
property for fields, not only types, when recreating schemas. PR #580 - Fix
delegateToSchema.js
to accept and move forward args with zero or false values PR #586
- Fix a bug where inline fragments got filtered in merged schemas when a type implemented multiple interfaces PR #546
- IEnumResolver value can be a
number
type PR #568
- Include
astNode
property in schema recreation PR #569
- Added GraphQL Subscriptions support for schema stitching and
makeRemoteExecutableSchema
PR #563 - Make
apollo-link
a direct dependency PR #561 - Update tests to use
graphql-js@0.12
docstring format PR #559
- Validate query before delegation PR #551
- Add guard against invalid schemas being constructed from AST PR #547
Update to add support for graphql@0.12
, and drop versions before 0.11
from the peer dependencies list. The graphql
package has some breaking changes you might need to be aware of, but there aren't any breaking changes in graphql-tools
itself, or common usage patterns, so we are shipping this as a minor version. We're also running tests on this package with both graphql@0.11
and graphql@0.12
until we confirm most users have updated.
- Visit the
graphql
releases page to keep track of for breaking changes to the underlying package. - PR #541
- (Experimental) Added support for custom directives on FIELD_DEFINITION that wrap resolvers with custom reusable logic. Issue #212 PR #518 and PR #529
- Allow passing in a string
schema
tomakeRemoteExecutableSchema
PR #521
- Merge schema now can accept resolvers in a plain object format, mergeInfo added to GraphQLResolveInfo object in merged schema resolvers PR #511
- Added basic support for custom Enums Issue #363 PR #507 Read the docs here
- Added basic subscription support for local schemas Issue #420 PR #463
- Fix input object default value not propagating to merged schema Issue #497 [PR #498](PR #463](ardatan#498)
- Add the option
resolverValidationOptions.allowResolversNotInSchema
to allow resolvers to be set even when they are not defined in the schemas PR #444 - Fix schema stitching bug when aliases are used with union types and fragments PR #482
- Remove
isTypeOf
guards from merged schemas PR #484
- Incompatible fragments are now properly filtered PR #470
- Made
resolvers
parameter optional formergeSchemas
Issue #461 PR #462 - Make it possible to define interfaces in schema extensions PR #464
- Upgraded versions of dependencies
- Fix one place where
apollo-link
was being used directly
- Removed direct dependency on Apollo Link, while keeping the API the same, to work around a Launchpad npm installation issue temporarily.
- Parse type, field, and argument descriptions in
typeFromAST
. This allows the descriptions to be part of the schema when using helpers likemergeSchemas()
.
- Add ability to pass types in extension strings Issue #427 PR #430
- Translate errors better in merged schema Issue #419 PR #425
- Fix alias issues Issue #415 PR #418
- Make
@types/graphql
a dev dependency and make it's version as flexible asgraphql
PR #421
- Fix inability to add recursive queries PR #413
- Change link API to pass GraphQL context as
graphqlContext
field of link context to avoid merging problems - Fix alias problems in schema merging PR #411
- Added support for passing an Apollo Link instead of a fetcher
- Add schema merging utilities PR #382
- Update package.json to allow GraphQL.js 0.11 Issue #394 PR #395
- Fix typings for resolver options: Issue #372 PR #374
- Use defaultFieldResolver from graphql-js package instead of own one PR #373
- Remove
lodash
dependency PR #356
- Improve mocking of union and interface types PR #332
- Add argument validation in
addMockFunctionsToSchema
for 'schema' property in parameter object PR #321
- Remove dependency on
graphql-subscription
and use an interface for PubSub PR #295 - Support schema AST as a type definition input PR #300
- Update graphql typings to 0.9.0 PR #298
- Update dependencies PR #287
- Restrict version range of graphql-js peer dependency to ^0.8.0 || ^0.9.0 PR #266
- Update graphql-js dependency to include 0.9.0 PR #264
- Fix logErrors option so it logs errors if resolve function returns a promise PR #262
- use function reference instead of string for concatenateTypeDefs. PR #252
- Migrate from
typed-graphql
to@types/graphql
. PR #249
addSchemaLevelResolveFunction
resolves once per operation type and not once globally. #220- Replace node-uuid with uuid package #227
- Fix issue that prevented usage of custom scalars as arguments #224
- Remove peer dependency on
graphql-subscriptions
. #210
- Accept an async function for the schema level resolver. (@ephemer in #199)
- Fix for new custom scalar support introduced in
0.8.1
. (@oricordeau in #203)
- Support custom scalar types developed for GraphQL.js, such as graphql-type-json. (@oricordeau in #189)
- Update default resolve function to match the one from GraphQL.js (@stubailo in #183)
- Move
typed-graphql
tooptionalDependencies
(@stubailo in #183) - Set new defaults for resolver validation to match GraphQL.js so that developers need to opt-in to advanced validation (@stubailo in #183):
requireResolversForArgs = false
*requireResolversForNonScalar = false
- Fix dependency on lodash
-
Various Bugfixes (@DxCx in #129) - Istanbul coverage was not working well due to Istanbul bug #549 - Bluebird promise was not converted well on tests - "console.warn" got overwritten on tests
-
Changed GraphQL typings requirement from peer to standard (@DxCx in #129)
-
Change the missing resolve function validator to show a warning instead of an error (@nicolaslopezj in #134)
-
Add missing type annotations to avoid typescript compiler errors when 'noImplicitAny' is enabled (@almilo in #133)
-
Fix issue in addMockFunctionsToSchema when preserveResolvers is true and connector/logger is used. (@DxCx in #121)
-
Fix multiple issues in addMockFunctionsToSchema when preserveResolvers is true (support for Promises, and props defined using Object.defineProperty) (@sebastienbarre in #115)
-
Make allowUndefinedInResolve true by default (@jbaxleyiii in #117)
-
Add
requireResolversForAllFields
resolver validation option (@nevir in #107)
- Make mocking partial objects match expected behavior (@sebastienbarre in #96)
- Improved behavior when mocking interfaces & unions (@itajaja in #102)
- Unpin babel-core version to solve build problem (PR #92)
- Added support for
extend
keyword to schemaGenerator (PR #90)
- Fix a bug with addSchemaLevelResolveFunction. It now runs once per tick (PR #91)
- Add addSchemaLevelResolveFunction to exports
- Remove dist folder before prepublish to make sure files deleted in source are not included in build
- Updated GraphQL dependency to 0.6.0
- Removed all tracer code, including
Tracer
,addTracingToResolvers
anddecorateWithTracer