I am using apollo gateway as follows.
// index.ts
const apolloGateway = new ApolloGateway({
supergraphSdl,
buildService: ({ name, url }) => {
if (name === 'local') {
return new LocalGraphQLDataSource(
buildSubgraphSchema({
typeDefs,
resolvers,
}),
);
}
return new MyStoreDataSource(name as ServiceName, {
url,
});
},
});
// resolvers.ts
export const QueryResolver = {
Query: {
async user_list(source, args, context, info) {
...
return remote.call // request with info and [UserItem!]!
},
},
UserItem: {
name: {
selectionSet: '{ id, age }', // not working
resolve(user_item: any, args: any, context: Context, info: GraphQLResolveInfo) {
...
}
}
}
};
I’d like to use a selectionSet like stitch for the resolver, but this doesn’t seem to work unfortunately.
can i solve this?