Skip to content

Commit

Permalink
comment: Leave traces/suggestions about future work.
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix committed May 12, 2020
1 parent 63776c2 commit f75e049
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
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,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
Original file line number Diff line number Diff line change
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 f75e049

Please sign in to comment.