Skip to content

Service Polling / Live Schema Updates - Possible? #1142

Open
@ajzozakiewicz

Description

@ajzozakiewicz

It is possible to have the mesh gateway poll running services for schema changes? Or trigger it to reload its sources somehow?

Current code snippet I am experimenting with:

const { ApolloServer } = require('apollo-server')
const { findAndParseConfig } = require('@graphql-mesh/config')
const { getMesh } = require('@graphql-mesh/runtime')

async function main() {
  const meshConfig = await findAndParseConfig();
  const { schema, contextBuilder } = await getMesh(meshConfig);

  const context = await contextBuilder({
    testProp: 'test'
  })

  const apolloServer = new ApolloServer({
    schema,
    context
  });

  const { url } = await apolloServer.listen(4000);
  console.info(`🚀 Server ready at ${url}`);
}

main().catch(err => console.error(err));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions