MCPcopy Create free account
hub / github.com/bautistaaa/narutoQL / createGraphqlServer

Function createGraphqlServer

src/server/createGraphqlServer.ts:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { GraphQLError } from 'graphql';
8
9const createGraphqlServer = async () => {
10 const formatError = (error: GraphQLError) => {
11 return {
12 message: error.message,
13 statusCode: error?.extensions?.exception?.statusCode,
14 };
15 };
16 const schema = await buildSchema({
17 resolvers: [CharacterResolver, ClanResolver, VillageResolver],
18 });
19
20 return new ApolloServer({
21 schema,
22 validationRules: [depthLimit(4)],
23 formatError,
24 });
25};
26
27export default createGraphqlServer;

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected