@theguild/federation-composition
Version:
Open Source Composition library for Apollo Federation
12 lines (11 loc) • 364 B
JavaScript
import { GraphQLError } from "graphql";
export function ReservedSubgraphNameRule(context) {
if (context.getSubgraphName() === "_") {
context.reportError(new GraphQLError(`Invalid name _ for a subgraph: this name is reserved`, {
extensions: {
code: "INVALID_SUBGRAPH_NAME",
},
}));
}
return {};
}