MichalLytek / MichalLytek/type-graphql

Examples do not reflect real-world use (data fetching is async)

Open
#1,784 2 comments 0 reactions 0 assignees View on GitHub
Community :family_man_girl: Documentation :book:
Dominant language
TypeScript
Stars
8.1k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

# Describe the issue

The docs and examples talk about data being loaded from a database (which would be an asynchronous process), but they actually _show_ data generated _synchronously_, such as in [simple-usage/recipe.resolver](https://github.com/MichalLytek/type-graphql/blob/master/examples/simple-usage/recipe.resolver.ts#L17) where the source data (`items`) is available statically. In almost any real-world scenario, `createRecipeSamples` would be async.

# Are you able to make a PR that fix this?

Yes, once I have the knowledge.

# Additional context

Love the idea of this library!

Contributor guide

Open the contributing guide

Research direction

Start with examples/simple-usage/recipe.resolver.ts at the createRecipeSamples usage and review the related documentation and examples that describe database-loaded data. Update the examples so their data-fetching behavior reflects asynchronous real-world use, then verify the example still works and its documentation matches.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.