Skip to content

Commit

Permalink
fix(exports): further streamline exports (#1348)
Browse files Browse the repository at this point in the history
transforms implementation may change in future versions
also includes change to internal name of defaultCreateRemoteResolver to match exported name
  • Loading branch information
yaacovCR committed Apr 6, 2020
1 parent d1024b8 commit 4c4c267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/wrap/index.ts
@@ -1,15 +1,9 @@
export {
applySchemaTransforms,
applyRequestTransforms,
applyResultTransforms,
} from './transforms';

export { transformSchema } from './transformSchema';
export { wrapSchema } from './wrapSchema';
export { transformSchema } from './transformSchema';

export * from './transforms/index';

export {
default as makeRemoteExecutableSchema,
createResolver as defaultCreateRemoteResolver,
defaultCreateRemoteResolver,
} from './makeRemoteExecutableSchema';
6 changes: 3 additions & 3 deletions src/wrap/makeRemoteExecutableSchema.ts
Expand Up @@ -32,7 +32,7 @@ export default function makeRemoteExecutableSchema({
schema: schemaOrTypeDefs,
link,
fetcher,
createResolver: customCreateResolver = createResolver,
createResolver = defaultCreateRemoteResolver,
buildSchemaOptions,
}: {
schema: GraphQLSchema | string;
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function makeRemoteExecutableSchema({
operation: Operation;
}): GraphQLFieldResolver<any, any> {
if (operation === 'query' || operation === 'mutation') {
return customCreateResolver(finalFetcher);
return createResolver(finalFetcher);
}
return createSubscriptionResolver(link);
}
Expand All @@ -80,7 +80,7 @@ export default function makeRemoteExecutableSchema({
return remoteSchema;
}

export function createResolver(
export function defaultCreateRemoteResolver(
fetcher: Fetcher,
): GraphQLFieldResolver<any, any> {
return async (_root, _args, context, info) => {
Expand Down

0 comments on commit 4c4c267

Please sign in to comment.