Apache Thrift
Easily generate executable schema for Apache Thrift services with GraphQL Mesh Thrift handler.Get started by installing `@graphql-mesh/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:
yarn add @omnigraph/thrift
pnpm add @omnigraph/thrift
bun add @omnigraph/thrift
How to use?
Then you can import the library in your configuration file, and define your Thrift source;
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'
})
}
]
})