Compose
Source Handlers
Thrift

Apache Thrift

💡

This page is currently under construction and expected to change. Please feel free to reach out to us directly in case you are having any troubles.

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'
      })
    }
  ]
})