Skip to content
View as Markdown

Application ​

By creating an application manifest, you can create your API endpoint for the services you use. This API endpoint will provide all the Queries and Mutations of each service, including those you defined.

In the spec property, the following child properties can be defined:

Properties

  • name: The gateway name. Name of the gateway that will be used as the application's subdomain, e.g. setting name to my-app will create API endpoints at my-app-{WORKSPACE_HASH}.erp.dev/query. Cannot duplicate a NAME that is being used by other users. (required)
  • cors: The origins. Defines the origin to which requests are allowed.
  • allowedIpAddresses: A list of IP addresses authorized to access the application, preventing unauthorized access. Each entry is a string in the format CIDR. Example: ["1.1.1.1/32", "2.2.2.0/24"]. To restrict access more broadly across an organization or folder, see IP Restriction.
  • auth: The authentication service. Defines the authentication service to be used. It takes a single defineAuth() value, not an array.
  • The services you use, each under its own property: db, resolver, executor, workflow, httpAdapter, idp, staticWebsites and aiGateways. The db, resolver, executor, workflow and idp services each become a subgraph of the application's GraphQL endpoint. httpAdapter instead exposes REST-style HTTP endpoints backed by existing GraphQL operations, staticWebsites serves static files, and aiGateways exposes a separate OpenAI-compatible API — none of these three add GraphQL queries or mutations to the application.

To deploy an application, you'll need to enable at least one service.

Example

typescript
import { defineAuth, defineConfig } from "@tailor-platform/sdk";
import { user } from "./db/user";

const auth = defineAuth("my-auth", {
  userProfile: { type: user, usernameField: "email" },
});

export default defineConfig({
  name: "my-app",
  db: {
    "my-db": { files: ["db/**/*.ts"] },
  },
  resolver: {
    "my-resolver": { files: ["resolver/**/*.ts"] },
  },
  auth,
});