Skip to main content

generate_typescript_graphql

Function generate_typescript_graphql 

Source
pub fn generate_typescript_graphql(schema: &str, target: &str) -> Result<String>
Expand description

Generate TypeScript GraphQL code from a schema

Parses the GraphQL schema string and generates complete TypeScript code based on the target specification.

§Arguments

  • schema - GraphQL schema as a string (SDL format)
  • target - Generation target: “all” (complete), “types” (types only), “resolvers” (resolvers), or “schema” (schema definition)

§Returns

Generated TypeScript code as a string, or an error if parsing/generation fails