Getting Started
Installation
Install Universal Data Layer and start the GraphQL server
Quick Start
The fastest way to try Universal Data Layer is using npx:
Terminal
npx universal-data-layer
This starts a GraphQL server at http://localhost:4000/graphql with a basic schema.
Installation
For local development, install UDL as a project dependency:
npm install universal-data-layer
pnpm add universal-data-layer
yarn add universal-data-layer
bun add universal-data-layer
Starting the Server
Once installed, start the GraphQL server:
npx universal-data-layer
# Add to package.json scripts: "udl": "universal-data-layer"
npm run udl
Available Endpoints
Once the server is running, you'll have access to:
| Endpoint | URL | Description |
|---|---|---|
| GraphQL API | http://localhost:4000/graphql | POST queries here |
| GraphiQL | http://localhost:4000/graphiql | Interactive query IDE |
Configuration File
UDL uses a configuration file to define plugins and settings. Create a udl.config.ts file in your project root:
udl.config.ts
import { defineConfig } from 'universal-data-layer';
export const config = defineConfig({
port: 4000,
plugins: [],
});
The defineConfig helper provides TypeScript autocompletion and validation. Supported config file names:
udl.config.ts(recommended)udl.config.jsudl.config.mjs
Next Steps
- Your First Query - Make your first GraphQL query
- Exploring GraphQL - Learn GraphQL basics with GraphiQL
- Production Deployment - Deploy UDL for production use