API servicemedium

Recipe catalogue GraphQL API

A GraphQL API with cursor pagination, filtering, validated mutations and no N+1 queries.

Suggested effort
~4h focused work
Window
24 hours
Starts from
An empty repo
Stack
Requires GraphQL
Sign in to start this build →

Opens in a new tab. The clock starts when you press Start inside the environment, not before, and your workspace is kept while you step away.

Time window 24 hours. Suggested effort about 4 hours.

Context

A cooking site wants to move its recipe catalogue behind a GraphQL API so its web and mobile clients can ask for exactly the fields they need.

Core requirements

  • Schema with Recipe (id, title, description, minutes, servings, tags, ingredients, steps, author) and Ingredient (name, quantity, unit).
  • Seed at least 25 recipes on startup from a JSON file you commit.
  • Query recipes(filter, first, after) with cursor pagination (Relay-style edges and pageInfo). Filters: tag, maximum minutes, text search on title, and "contains ingredient".
  • Query recipe(id).
  • Mutations createRecipe, updateRecipe, deleteRecipe with input validation.
  • Errors come back as typed results or GraphQL errors with useful messages, never stack traces.

Acceptance criteria

  • Paginating through all recipes with first: 5 visits each recipe exactly once, in a stable order.
  • Fetching a page of recipes with their authors does not issue one query per recipe (batch or join; explain how).
  • Validation rejects empty titles, non-positive minutes or servings, and empty ingredient lists.
  • Tests run real GraphQL operations against the schema.

Stretch goals (optional)

  • API-key auth where only the author may update or delete their recipe.
  • A query depth or complexity limit.
  • A subscription for newly created recipes.

Constraints

  • Any GraphQL server. Suggested: Apollo Server or GraphQL Yoga (Node), Strawberry (Python), gqlgen (Go).

Deliverables (every project)

  • Source code committed in this repository (the grader diffs against the first commit).
  • README.md that replaces the stub, with: how to install, run and test it (copy-pasteable commands); the decisions and trade-offs you made; what you would do next with more time; and a short note on how you used the AI agent (what you delegated, what you checked or rewrote).
  • Automated tests that run with a single command (npm test, pytest, go test ./... or cargo test).
  • No secrets in the repository. Anything configurable reads from environment variables with safe defaults.

Ground rules

  • The 24-hour clock is a window, not a workload. Stop at roughly the suggested effort, then write down what you would do next. A small, finished, tested core beats a large unfinished one.
  • Use the AI agent as much or as little as you like: every prompt is recorded and the report shows how it was used. You are judged on the result and on whether you understood and verified what the agent produced.
  • The work is yours. PraxisAI uses it only to produce your assessment report.
Recipe catalogue GraphQL API: a 24-hour take-home project | PraxisAI