mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.35k stars 237 forks source link

Clean up index.js file from gateway init instructions #887 #889

Closed codeflyer closed 2 years ago

codeflyer commented 2 years ago

Cleanup of the index file.

the stuff related to the gateway are moved in a separate file and the initialization is done with:

  let gateway
  let lruGatewayResolvers
  if (opts.gateway) {
    lruGatewayResolvers = buildCache(opts)
    gateway = await initGateway(opts, fastifyGraphQl, app)

    schema = gateway.schema
  }

Further improvement are required but this is the first step required for the gateway extraction.

@simoneb @mcollina