Skip to content

Latest commit

 

History

History
867 lines (608 loc) · 28 KB

CHANGELOG.md

File metadata and controls

867 lines (608 loc) · 28 KB

@graphql-tools/schema

10.0.6

Patch Changes

10.0.5

Patch Changes

10.0.4

Patch Changes

10.0.3

Patch Changes

10.0.2

Patch Changes

10.0.1

Patch Changes

10.0.0

Major Changes

Patch Changes

9.0.19

Patch Changes

9.0.18

Patch Changes

9.0.17

Patch Changes

9.0.16

Patch Changes

9.0.15

Patch Changes

9.0.14

Patch Changes

9.0.13

Patch Changes

9.0.12

Patch Changes

9.0.11

Patch Changes

9.0.10

Patch Changes

9.0.9

Patch Changes

9.0.8

Patch Changes

9.0.7

Patch Changes

9.0.6

Patch Changes

9.0.5

Patch Changes

9.0.4

Patch Changes

9.0.3

Patch Changes

9.0.2

Patch Changes

9.0.1

Patch Changes

9.0.0

Major Changes

  • #4463 8cc8721f Thanks @ardatan! - Thanks @mattkrick and @borisno2!

    Breaking changes

    addResolversToSchema;

    If you are using the legacy parameters like below, you should update them to the new usage. Other than that, there is no functional change;

    // From
    addResolversToSchema(schema, resolvers, resolverValidationOptions)
    
    // To
    addResolversToSchema({
      schema,
      resolvers,
      resolverValidationOptions
    })

    mergeSchemas;

    The provided resolver overrides the resolvers in the schema with the same name;

    The hello resolver in the schema would be overridden by the hello resolver in the resolvers. Before it was opposite which is not expected.

    const schema = makeExecutableSchema({
      typeDefs: `
        type Query {
          hello: String
        }
      `,
      resolvers: {
        Query: {
          hello: () => 'Hello world!'
        }
      }
    })
    
    mergeSchemas({
      schemas: [schema],
      resolvers: {
        Query: {
          hello: () => 'New hello world'
        }
      }
    })

    makeExecutableSchema no longer takes parseOptions and you can pass those options directly;

    makeExecutableSchema({
      typeDefs: ``,
      parseOptions: {
        assumeValid: true
      }
    })
    
    // After
    makeExecutableSchema({
      typeDefs: ``,
      assumeValid: true
    })

    makeExecutableSchema no longer does pruning and it doesn't take pruningOptions anymore. You can use pruneSchema from @graphql-tools/utils if you need.

    extractExtensionsFromSchema moved from @graphql-tools/merge to @graphql-tools/schema. And travelSchemaPossibleExtensions has been dropped in favor of mapSchema.

Patch Changes

8.5.1

Patch Changes

8.5.0

Minor Changes

  • d76a299c: Support TypeScript module resolution.

Patch Changes

8.4.0

Minor Changes

  • 4914970b: mergeSchemas was skipping defaultFieldResolver and defaultMergedResolver by default while extracting resolvers for each given schema to reduce the overhead. But this doesn't work properly if you mix wrapped schemas and local schemas. So new includeDefaultMergedResolver flag is introduced in getResolversFromSchema to put default "proxy" resolvers in the extracted resolver map for mergeSchemas.

    This fixes an issue with alias issue, so nested aliased fields weren't resolved properly because of the missing defaultMergedResolver in the final merged schema which should come from the wrapped schema.

Patch Changes

8.3.14

Patch Changes

8.3.13

Patch Changes

8.3.12

Patch Changes

8.3.11

Patch Changes

8.3.10

Patch Changes

8.3.9

Patch Changes

8.3.8

Patch Changes

8.3.7

Patch Changes

8.3.6

Patch Changes

  • 722abad7: Fix addResolversToSchema bug where type or field processing would be aborted prematurely.

    In previous versions, if requireResolversToMatchSchema was set to ignore, although no error would be thrown for an unexpected resolver type, type processing would still be aborted early. This fix changes the behavior to correctly continue resolver type processing with the next provided type.

    In previous versions, if a resolver field began with double underscores, it would correctly be used for legacy behavior to directly set a type property, but field processing would be aborted early. This fix changes the behavior to correctly continue type processing with the next field.

8.3.5

Patch Changes

8.3.4

Patch Changes

8.3.3

Patch Changes

  • 0c0c6857: fix - align versions
  • Updated dependencies [0c0c6857]

8.3.2

Patch Changes

8.3.1

Patch Changes

8.3.0

Minor Changes

  • 149afddb: fix: getting ready for GraphQL v16

Patch Changes

8.2.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]

8.1.2

Patch Changes

  • e50852e6: use version ranges instead of a fixed version for the graphql-tools package versions
  • Updated dependencies [e50852e6]

8.1.1

Patch Changes

8.1.0

Minor Changes

  • 67691b78: - schemaExtensions option has been added to mergeSchemas, makeExecutableSchema and stitchSchemas configurations

    Breaking Changes;

    • Move mergeSchemas and MergeSchemasConfig from @graphql-tools/merge to @graphql-tools/schema package to prevent circular dependency between them.
    • mergeSchemasAsync has been removed.
    • Move NamedDefinitionNode, resetComments, collectComment, pushComment and printComment from @graphql-tools/merge to @graphql-tools/utils.

Patch Changes

  • Updated dependencies [b9684631]
  • Updated dependencies [a5fb77a4]
  • Updated dependencies [9ede806a]
  • Updated dependencies [67691b78]

8.0.3

Patch Changes

8.0.2

Patch Changes

8.0.1

Patch Changes

8.0.0

Major Changes

  • 7d3e3006: BREAKING CHANGE
  • 7d3e3006: BREAKING CHANGE
    • Remove logger and addErrorLoggingToSchema
      • You can implement logging and debugging mechanism outside the resolvers using some kind of plugin system based library like Envelop
  • 7d3e3006: BREAKING CHANGE
    • Remove schema level resolvers feature and addSchemaLevelResolver
  • 7d3e3006: BREAKING CHANGE
    • No longer exports buildSchemaFromTypeDefinitions, use buildSchema from graphql-js instead
    • Remove allowUndefinedResolve option in makeExecutableSchema because GraphQL Schema itself does this checking

Patch Changes

  • 7d3e3006: enhance(schema): use merge package to handle typeDefs and resolvers merging
  • Updated dependencies [af9a78de]
  • Updated dependencies [9c26b847]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [dae6dc7b]
  • Updated dependencies [6877b913]
  • Updated dependencies [c42e811d]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [8c8d4fc0]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [74581cf3]
  • Updated dependencies [c0ca3190]
  • Updated dependencies [982c8f53]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [a31f9593]
  • Updated dependencies [7d3e3006]

7.1.5

Patch Changes

  • 22a9f3da: fix(deps): follow package conventions on when to pin

7.1.4

Patch Changes

  • 61da3e82: use value-or-promise to streamline working with sync values or async promises

7.1.3

Patch Changes

  • c8e26b8c: fix(schema): ignore resolvers if they are not in schema

7.1.2

Patch Changes

7.1.1

Patch Changes

  • b48a91b1: add ability to specify merge config within subschemas using directives
  • Updated dependencies [b48a91b1]

7.1.0

Minor Changes

  • 4f5a4efe: enhance(schema): add some options to improve schema creation performance

Patch Changes

  • 65ed780a: enhance(schema): do not visit resolvers if no validation is selected
  • b79e3a6b: enhance(schema): do not visit abstract types if requireResolversForResolveType not present
  • Updated dependencies [4f5a4efe]

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, warn or ignore rather than true or false. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior.

    • The allowResolversNotInSchema has been renamed to requireResolversToMatchSchema, to harmonize the naming convention of all the validators. The default setting of requireResolversToMatchSchema is error, matching the previous behavior.

    Schema Delegation (delegateToSchema & @graphql-tools/delegate)

    • The delegateToSchema return value has matured and been formalized as an ExternalObject, 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 including slicedError, getErrors, getErrorsByPathSegment functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The new getUnpathedErrors function is therefore necessary for retrieving only these errors. Note also the new annotateExternalObject and mergeExternalObjects functions, as well as the renaming of handleResult to resolveExternalValue.

    • Transform types and the applySchemaTransforms are now relocated to the delegate package; applyRequestTransforms/applyResultTransforms functions have been deprecated, however, as this functionality has been replaced since v6 by the Transformer abstraction.

    • The transformRequest/transformResult methods are now provided additional delegationContext and transformationContext arguments -- these were introduced in v6, but previously optional.

    • The transformSchema method may wish to create additional delegating resolvers and so it is now provided the subschemaConfig and final (non-executable) transformedSchema parameters. As in v6, the transformSchema is 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 individual transformSchema methods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers.

    • applySchemaTransforms parameters have been updated to match and support the transformSchema parameters above.

    Remote Schemas & Wrapping (wrapSchema, makeRemoteExecutableSchema, and @graphql-tools/wrap)

    • wrapSchema and generateProxyingResolvers now only take a single options argument with named properties of type SubschemaConfig. The previously possible shorthand version with first argument consisting of a GraphQLSchema and second argument representing the transforms should be reworked as a SubschemaConfig object.

    • Similarly, the ICreateProxyingResolverOptions interface that provides the options for the createProxyingResolver property of SubschemaConfig options has been adjusted. The schema property previously could be set to a GraphQLSchema or a SubschemaConfig object. This property has been removed in favor of a subschemaConfig property that will always be a SubschemaConfig object. The transforms property has been removed; transforms should be included within the SubschemaConfig object.`

    • The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either defaultMergedResolver or a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throught createMergedResolver has been deprecated, as custom merging resolvers conflicts when using stitching's type merging, where resolvers are expected to be identical across subschemas.

    • The WrapFields transform's wrappingResolver option 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 as TransformRootFields or TransformObjectFields.

    • The ExtendSchema transform has been removed, as it is conceptually simpler just to use stitchSchemas with one subschema.

    • The ReplaceFieldsWithFragment, AddFragmentsByField, AddSelectionSetsByField, and AddMergedTypeSelectionSets transforms has been removed, as they are superseded by the AddSelectionSets and VisitSelectionSets transforms. The AddSelectionSets purposely 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 the parseSelectionSet function from @graphql-tools/utils.

    Schema Stitching (stitchSchemas & @graphql-tools/stitch)

    • stitchSchemas's mergeTypes option is now true by default! This causes the onTypeConflict option to be ignored by default. To use onTypeConflict to select a specific type instead of simply merging, simply set mergeTypes to false.

    • schemas argument has been deprecated, use subschemas, typeDefs, or types, depending on what you are stitching.

    • When using batch delegation in type merging, the argsFromKeys function is now set only via the argsFromKeys property. Previously, if argsFromKeys was absent, it could be read from args.

    • Support for fragment hints has been removed in favor of selection set hints.

    • stitchSchemas now processes all GraphQLSchema and SubschemaConfig subschema input into new Subschema objects, handling schema config directives such aso@computed as well as generating the final transformed schema, stored as the transformedSchema property, if transforms are used. Signatures of the onTypeConflict, fieldConfigMerger, and inputFieldConfigMerger have been updated to include metadata related to the original and transformed subschemas. Note the property name change for onTypeConflict from schema to subschema.

    Mocking (addMocksToSchema and @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, and info with parent available as this rather than as the first argument.

    Other Utilities (@graphql-tools/utils)

    • filterSchema's fieldFilter will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to the objectFieldFilter option.
    • Unused fieldNodes utility functions have been removed.
    • Unused typeContainsSelectionSet function has been removed, and typesContainSelectionSet has been moved to the stitch package.
    • Unnecessary Operation type has been removed in favor of OperationTypeNode from upstream graphql-js.
    • As above, applySchemaTransforms/applyRequestTransforms/applyResultTransforms have been removed from the utils package, 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

6.2.4

Patch Changes

  • 533d6d53: Bump all packages to allow adjustments
  • Updated dependencies [32c3c4f8]
  • Updated dependencies [533d6d53]