Skip to content

Commit

Permalink
Inline PrintSchemaOptions type, whose parent module has been moved.
Browse files Browse the repository at this point in the history
This option will likely be deprecated in `graphql@16`.  For now, we'll
inline this type into this module to continue emitting it into the
declaration file for `makeRemoteExecutableSchema`.

This is necessary since the TypeScript compiler can no longer resolve its
previous location as `graphql` has moved the location of the `schemaPrinter`
module to `printSchema` in graphql/graphql-js#2426.

cc @IvanGoncharov
  • Loading branch information
abernix committed Feb 17, 2020
1 parent 972024f commit 713ffe2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/stitching/makeRemoteExecutableSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import resolveParentFromTypename from './resolveFromParentTypename';
import defaultMergedResolver from './defaultMergedResolver';
import { checkResultAndHandleErrors } from './errors';
import { observableToAsyncIterable } from './observableToAsyncIterable';
import { Options as PrintSchemaOptions } from 'graphql/utilities/schemaPrinter';

export type ResolverFn = (
rootValue?: any,
Expand All @@ -49,6 +48,27 @@ export type FetcherOperation = {
context?: { [key: string]: any };
};

/**
* This type has been copied inline from its source on `@types/graphql`:
*
* https://git.io/Jv8NX
*
* Previously, it was imported from `graphql/utilities/schemaPrinter`, however
* that module has been removed in `graphql@15`. Furthermore, the sole property
* on this type is due to be deprecated in `graphql@16`.
*/
interface PrintSchemaOptions {
/**
* Descriptions are defined as preceding string literals, however an older
* experimental version of the SDL supported preceding comments as
* descriptions. Set to true to enable this deprecated behavior.
* This option is provided to ease adoption and will be removed in v16.
*
* Default: false
*/
commentDescriptions?: boolean;
}

export default function makeRemoteExecutableSchema({
schema,
link,
Expand Down

0 comments on commit 713ffe2

Please sign in to comment.