Hypermode generates your Project’s GraphQL API schema from the exported functions in the index.ts file located in the functions / assembly folder of you project.

When deployed, your API is available on your project’s endpoint, visible in the Hypermode Console on the Project Home screen.

For example, with the following index.ts file:

import { inference } from "@hypermode/functions-as";

export function testClassifier(text: string): string {
  const modelName = "sentiment-classifier";
  const threshold: f32 = 0.5;
  return inference.classifyText(modelName, text, threshold);
}

The API endpoint serves the following GraphQL schema:

type Query {
  testClassifier(text: String!): String!
}

You can visualize the generated GraphQL schema by expanding the Documentation Explorer on the Project Query screen.