How to use the hops-config.graphqlMockServerPath function in hops-config

To help you get started, we’ve selected a few hops-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xing / hops / packages / apollo-mock-server / lib / mock-server-middleware.js View on Github external
const app = express();
  app.use(cookieParser());

  const server = new ApolloServer({
    schema: resolvedSchema,
    playground: {
      settings: {
        'request.credentials': 'same-origin',
      },
    },
    context: context => extendContext({ ...context, config: hopsConfig }),
  });

  server.applyMiddleware({
    app,
    path: hopsConfig.graphqlMockServerPath,
    cors: {
      credentials: true,
      origin: true,
      methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
      allowedHeaders: 'content-type',
    },
  });

  return app;
});
github xing / hops / packages / graphql / lib / mock-server-middleware.js View on Github external
const app = express();
  app.use(cookieParser());

  const server = new ApolloServer({
    schema: resolvedSchema,
    playground: {
      settings: {
        'request.credentials': 'same-origin',
      },
    },
    context: context => ({ ...context, config: hopsConfig }),
  });

  server.applyMiddleware({
    app,
    path: hopsConfig.graphqlMockServerPath,
    cors: {
      credentials: true,
      origin: true,
      methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
      allowedHeaders: 'content-type',
    },
  });

  return app;
});