Skip to content

Installation

Effect GraphQL requires:

  • Node.js 24 or later
  • TypeScript 5.0 or later (for full type inference)
Terminal window
npm install @effect-gql/core effect graphql

This installs:

  • @effect-gql/core - The core library
  • effect - The Effect runtime and Schema library
  • graphql - GraphQL.js for schema execution

For the best experience, ensure your tsconfig.json includes:

{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"skipLibCheck": true
}
}

Key settings:

  • strict: true - Enables full type checking (required for Effect)
  • target: ES2022 - Enables modern JavaScript features used by Effect
  • moduleResolution: NodeNext - Proper ESM resolution

If you want to use the decorator-based API (experimental), add:

{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}

Create a simple test file to verify everything is working:

test-install.ts
import { Effect } from "effect"
import * as S from "effect/Schema"
import { GraphQLSchemaBuilder } from "@effect-gql/core"
const schema = GraphQLSchemaBuilder.empty
.query("hello", {
type: S.String,
resolve: () => Effect.succeed("world"),
})
.buildSchema()
console.log("Schema created successfully!")
console.log("Query type:", schema.getQueryType()?.name)

Run it:

Terminal window
npx tsx test-install.ts

You should see:

Schema created successfully!
Query type: Query

Now that you have Effect GraphQL installed, continue to the Quick Start guide to build your first API.