Installation
Prerequisites
Section titled “Prerequisites”Effect GraphQL requires:
- Node.js 24 or later
- TypeScript 5.0 or later (for full type inference)
Install Dependencies
Section titled “Install Dependencies”npm install @effect-gql/core effect graphqlThis installs:
@effect-gql/core- The core libraryeffect- The Effect runtime and Schema librarygraphql- GraphQL.js for schema execution
TypeScript Configuration
Section titled “TypeScript Configuration”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 EffectmoduleResolution: NodeNext- Proper ESM resolution
Optional: Decorators
Section titled “Optional: Decorators”If you want to use the decorator-based API (experimental), add:
{ "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true }}Verify Installation
Section titled “Verify Installation”Create a simple test file to verify everything is working:
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:
npx tsx test-install.tsYou should see:
Schema created successfully!Query type: QueryNext Steps
Section titled “Next Steps”Now that you have Effect GraphQL installed, continue to the Quick Start guide to build your first API.