Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix committed May 12, 2020
2 parents da3de57 + 6b71ea4 commit 31004da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gateway-js/src/executeQueryPlan.ts
Expand Up @@ -89,11 +89,9 @@ export async function executeQueryPlan<TContext>(
},
rootValue: data,
variableValues: requestContext.request.variables,
// FIXME: GraphQL extensions currently wraps every field and creates
// a field resolver. Because of this, when using with ApolloServer
// the defaultFieldResolver isn't called. We keep this here
// because it is the correct solution and when ApolloServer removes
// GraphQLExtensions this will be how alias support is maintained
// We have a special field resolver which ensures we support aliases.
// FIXME: It's _possible_ this will change after `graphql-extensions` is
// deprecated, though not certain. See here, also: https://git.io/Jf8cS.
fieldResolver: defaultFieldResolverWithAliasSupport,
}));
} catch (error) {
Expand Down
4 changes: 4 additions & 0 deletions gateway-js/src/index.ts
Expand Up @@ -476,6 +476,10 @@ export class ApolloGateway implements GraphQLService {

this.logger.debug('Schema loaded and ready for execution');

// FIXME: The comment below may change when `graphql-extensions` is
// removed, as it will be soon. It's not clear if this will be temporary,
// as is suggested, after that time, because we still very much need to
// do this special alias resolving. Original comment:
// this is a temporary workaround for GraphQLFieldExtensions automatic
// wrapping of all fields when using ApolloServer. Here we wrap all fields
// with support for resolving aliases as part of the root value which
Expand Down

0 comments on commit 31004da

Please sign in to comment.