GraphQL

Add a graphql endpoint inside any server block. NAIDE auto-generates the GraphQL schema from your schema declarations.

Basic Setup

server app port 3000:
  graphql "/graphql"

This creates a GraphQL endpoint at /graphql with a default "hello" query.

Auto-Schema Generation

Define schemas in your server, and NAIDE generates matching GraphQL types and queries automatically:

server app port 3000:
  schema User:
    id auto
    name str
    email str

  schema Post:
    id auto
    title str
    body str

  graphql "/graphql"

This generates:

Type Mapping

NAIDE Type GraphQL Type
strString
intInt
numFloat
boolBoolean
autoID

Multi-Target

Target Library
Node.js graphql + graphql-http
Bun graphql (inline handler)
Python graphene + flask-graphql