Pylon

A code-first approach to GraphQL API development

Real-time Schema

Type Safety

OIDC Auth

Role-Based

Logging

Error Tracking

Prisma Integration

Docker Ready

Pylon Hero Section (opens in a new tab)

The GraphQL schema is generated in real-time from your TypeScript definitions, allowing you to focus solely on writing your service logic. This approach significantly improves development speed, enhances type safety, and reduces errors.

Any breaking changes in your code are instantly reflected in your API, enabling you to immediately see how changes impact its functionality.

With Pylon, you can build a GraphQL API in minutes, not hours.

Overview

import { defineService, logger } from "@getcronit/pylon";
 
export default defineService({
  Query: {
    sum: (a: number, b: number) => {
      logger.info(`Calculating sum of ${a} and ${b}`);
      return a + b;
    },
  },
  Mutation: {
    divide: (a: number, b: number) => {
      if (b === 0) {
        logger.error('Attempt to divide by zero');
        throw new Error('Division by zero is not allowed');
      }
      logger.info(`Dividing ${a} by ${b}`);
      return a / b;
    },
  },
});

In this example, we define a simple service with two operations: sum and divide. The type definitions for the arguments and return values are automatically inferred from the function signatures. Pylon generates the corresponding GraphQL schema based on these definitions.

Pylon offers a comprehensive set of features to streamline the development of modern web services:

  • Automatic GraphQL API Generation: Pylon generates GraphQL schemas based on your TypeScript definitions, ensuring type safety and reducing manual coding effort.
  • Type Safety: By leveraging TypeScript, Pylon ensures that your services are type-safe, catching errors at compile time.
  • Authentication and Authorization: Built-in support for OIDC standard and integration with ZITADEL for managing user authentication and role-based access control.
  • Logging and Monitoring: Integrated with Winston for logging and Sentry for error tracking, providing robust monitoring capabilities.
  • Database Integration: Seamlessly works with Prisma to generate extended models that support automatic resolution of relations and paginatable connections.
  • Deployment Ready: Includes pre-configured Dockerfile for easy deployment using Docker or manual methods.

Features

Pylon brings a host of features to make web service development faster and more efficient:

  • Real-time GraphQL schema generation
  • Enhanced type safety with TypeScript
  • Built-in authentication and authorization
  • Robust logging and monitoring
  • Seamless database integration
  • Optimized deployment process

These features ensure that you can focus on building your service logic while Pylon handles the boilerplate and infrastructure concerns.

Community

starsdownloadslicense

Pylon is maintained by the team at cronit. Stay updated with the latest developments and join the community discussions:

Feel free to explore the documentation and contribute to the project!