v1
Source Handlers
Thrift

Apache Thrift

This handler allows you to consume Apache Thrift .thrift files and generate a remote executable schema for those services.

To get started, install the handler library:

npm i @omnigraph/thrift

How to use?

Then you can import the library in your configuration file, and define your Thrift source;

mesh.config.ts
import { defineConfig } from '@graphql-mesh/compose-cli'
import { loadThriftSubgraph } from '@omnigraph/thrift'
 
export const composeConfig = defineConfig({
  subgraphs: [
    {
      sourceHandler: loadThriftSubgraph('Calculator', {
        idl: './src/thrift/calculator.thrift',
        hostName: 'localhost',
        port: 8080,
        path: '/thrift',
        serviceName: 'calculator-service'
      })
    }
  ]
})