INNER CODE UNIT · TypeScript

addExample

graphql-compose/graphql-compose-examples · index.ts:60

async function addExample(example, uri) {
  example.uri = `/${uri}`;

  const server = new ApolloServer({
    schema: example.schema,
    introspection: true,
    plugins: [
      ApolloServerPluginLandingPageGraphQLPlayground({
        subscriptionEndpoint:
          process.env.SUBSCRIPTION_ENDPOINT || `ws://localhost:${PORT}/northwind`,
      }),
      ...(example.plugins || []),
    ],
  });
  await server.start();
  server.applyMiddleware({ app: app as any, path: example.uri });

  app.use(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…