{"id":26187,"library":"relay-compiler-experimental","title":"Relay Compiler Experimental","description":"Experimental version of the Relay Compiler, part of Meta's Relay GraphQL client ecosystem. This package (v0.0.1) is an unstable pre-release intended for testing new compiler features before they migrate to the stable relay-compiler package. It follows the same release cadence as the main Relay monorepo but may introduce breaking changes without notice. Key differentiators: early access to compiler experiments, potential for rapid iteration, but no stability guarantees. Not recommended for production use.","status":"deprecated","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/facebook/relay","tags":["javascript","graphql","relay"],"install":[{"cmd":"npm install relay-compiler-experimental","lang":"bash","label":"npm"},{"cmd":"yarn add relay-compiler-experimental","lang":"bash","label":"yarn"},{"cmd":"pnpm add relay-compiler-experimental","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"GraphQL parser and utilities required for compilation","package":"graphql","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require not supported.","wrong":"const relayCompiler = require('relay-compiler-experimental')","symbol":"default","correct":"import relayCompiler from 'relay-compiler-experimental'"},{"note":"Named export, not default.","wrong":"import compile from 'relay-compiler-experimental'","symbol":"compile","correct":"import { compile } from 'relay-compiler-experimental'"},{"note":"Type available only in experimental package.","wrong":"import { Program } from 'relay-compiler'","symbol":"Program","correct":"import { Program } from 'relay-compiler-experimental'"}],"quickstart":{"code":"import { compile } from 'relay-compiler-experimental';\n\nconst source = `\n  query UserQuery {\n    user(id: \"1\") {\n      name\n    }\n  }\n`;\n\nconst result = compile(source, {\n  schemaPath: './schema.graphql',\n  artifactDirectory: './__generated__',\n});\n\nconsole.log(result);","lang":"typescript","description":"Demonstrates compiling a GraphQL query with the experimental compiler, specifying schema and output directory."},"warnings":[{"fix":"Migrate to relay-compiler (stable) which includes most experimental features.","message":"relay-compiler-experimental is no longer maintained; use relay-compiler instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Pin to exact version and test upgrades thoroughly.","message":"Breaking changes may occur between minor versions without a major version bump.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use only one compiler package per project.","message":"Experimental features may conflict with stable relay-compiler artifacts; avoid using both in same project.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install relay-compiler-experimental' or check package.json.","cause":"Package not installed or not resolved correctly.","error":"Error: Cannot find module 'relay-compiler-experimental'"},{"fix":"Use ESM imports or set type: \"module\" in package.json.","cause":"Using CommonJS require with ESM-only package.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use named imports: import { compile } from 'relay-compiler-experimental'.","cause":"Importing default export incorrectly; package has named exports.","error":"TypeError: relayCompiler is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}