Skip to content

feat: add Python GraphQL category (Strawberry)#148

Merged
Marve10s merged 1 commit intomainfrom
feat/add-python-strawberry-v2
Apr 11, 2026
Merged

feat: add Python GraphQL category (Strawberry)#148
Marve10s merged 1 commit intomainfrom
feat/add-python-strawberry-v2

Conversation

@Marve10s
Copy link
Copy Markdown
Owner

Summary

  • Adds pythonGraphql as a new category in the Python ecosystem with Strawberry as the initial option
  • Strawberry is a code-first Python GraphQL library using dataclasses and type hints (14k+ GitHub stars)
  • Framework-specific integration for all 4 Python web frameworks: FastAPI, Flask, Django, and Litestar
  • Framework-specific extras in pyproject.toml: strawberry-graphql[fastapi], [flask], [django], [litestar]

Files changed (33 files)

Types (4 files)

  • packages/types/src/schemas.tsPythonGraphqlSchema = z.enum(["strawberry", "none"])
  • packages/types/src/types.tsPythonGraphql type
  • packages/types/src/option-metadata.ts — category metadata, label overrides
  • packages/types/src/compatibility.tsCompatibilityCategory, CompatibilityInput, display name

Templates (3 files)

  • packages/template-generator/templates/python-base/src/app/graphql_schema.py.hbsnew Book query/mutation schema
  • packages/template-generator/templates/python-base/pyproject.toml.hbs — conditional strawberry-graphql dependency
  • packages/template-generator/templates/python-base/src/app/main.py.hbs — GraphQL route mounting per framework

CLI (9 files)

  • apps/cli/src/index.ts — schema import, router input, createVirtual config
  • apps/cli/src/constants.ts — default value
  • apps/cli/src/prompts/python-ecosystem.tsgetPythonGraphqlChoice() prompt
  • apps/cli/src/prompts/config-prompts.ts — prompt wiring
  • apps/cli/src/mcp.ts — 6 spots (import, SCHEMA_MAP, ECOSYSTEM_CATEGORIES, buildProjectConfig, buildCompatibilityInput)
  • apps/cli/src/utils/bts-config.ts — field mapping
  • apps/cli/src/utils/config-processing.ts — flag processing
  • apps/cli/src/utils/generate-reproducible-command.ts--python-graphql flag
  • apps/cli/src/helpers/core/command-handlers.ts — error fallback config

Web (8 files)

  • apps/web/src/lib/constant.ts — TECH_OPTIONS entry, category order, preset templates
  • apps/web/src/lib/preview-config.ts — stackToConfig mapping
  • apps/web/src/lib/stack-defaults.ts — StackState type + default
  • apps/web/src/lib/stack-url-keys.ts — URL key pgql
  • apps/web/src/lib/stack-url-state.ts — 3 spots (load, serialize, search)
  • apps/web/src/lib/stack-utils.ts — category order + command generation
  • apps/web/src/lib/tech-icons.ts — icon entry
  • apps/web/src/lib/tech-resource-links.ts — docs/GitHub URLs
  • apps/web/src/lib/stack-option-normalization.ts — normalization mapping

Tests (5 files)

  • apps/cli/test/generate-reproducible-command.test.ts — updated makeConfig + expected commands
  • apps/cli/test/add-history-commands.test.ts — updated CLI args + expected command
  • apps/cli/test/template-snapshots.test.ts — added pythonGraphql to all Python snapshot configs

Smoke tests (4 files)

  • testing/lib/presets.ts — base config + preset overrides
  • testing/lib/generate-combos/options.ts — import, sampleScalar, base config
  • testing/lib/generate-combos/types.ts — fingerprint key
  • testing/lib/generate-combos/render.ts — fingerprint + flag rendering

Test plan

  • bun test apps/cli/test/cli-builder-sync.test.ts — 358 pass (auto-detects schema/builder/CLI parity)
  • bun test apps/cli/test/generate-reproducible-command.test.ts — 5 pass
  • bun test apps/cli/test/template-snapshots.test.ts -u — 66 pass (snapshots updated)
  • bun test apps/cli/test/python-language.test.ts — 112 pass
  • bun run --cwd apps/cli check-types — clean
  • bun run --cwd apps/web typecheck — clean
  • bun run --cwd apps/web validate:tech-links — clean
  • Scaffold 4 combos (FastAPI, Flask, Litestar, Django + strawberry) + python3 -m compileall on each — all clean
  • Scaffold FastAPI + pythonGraphql: none — no graphql files generated

Add pythonGraphql as a new category in the Python ecosystem with
Strawberry as the initial option. Strawberry uses Python dataclasses
and type hints for a code-first GraphQL schema approach.

- Schema: PythonGraphqlSchema with "strawberry" and "none" values
- Templates: graphql_schema.py.hbs with Book query/mutation example
- Framework integration: FastAPI (GraphQLRouter), Flask (GraphQLView),
  Django (GraphQLView), Litestar (make_graphql_controller)
- Dependencies: strawberry-graphql with framework-specific extras
  ([fastapi], [flask], [django], [litestar])
- Full CLI, web builder, MCP, and smoke test wiring
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
better-fullstack-web Ignored Ignored Apr 10, 2026 8:09pm

@github-actions github-actions bot added size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 10, 2026
@Marve10s Marve10s merged commit 2b5e41c into main Apr 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant