typewriter-graphql
GraphQL SDL emitter for the typewriter SDK.
What It Generates
| Rust | GraphQL SDL |
|---|---|
struct |
type Name { field: Type! } |
Simple enum |
enum Name { VARIANT1 VARIANT2 } |
Tagged enum |
union Name = V1 | V2 + individual type per variant |
Option<T> |
Nullable field (no ! suffix) |
Vec<T> |
[T!] |
HashMap<K,V> |
JSON (custom scalar) |
Uuid |
ID |
DateTime<Utc> |
DateTime (custom scalar) |
Example Output
# Auto-generated by typewriter v0.4.0. DO NOT EDIT.
# Source: UserProfile
"""
A user profile in the system.
"""
type UserProfile {
""" Unique user identifier """
id: String!
email: String!
age: Int
tags: [String!]!
}
Usage
Used internally by typewriter-macros. Most users should depend on the main typewriter crate.
License
Apache-2.0 — Aarambh Dev Hub