gajus / gajus/graphql-lazyloader

object not found. How to handle it elegantly?

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
89
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Dear,

i find this pattern very useful. However, it introduce a new issue on our side.

Let's take as running example the one in this repo.

Before, the entire person was loaded in the person resolver. Now, making use of the dataloader the person is loaded in the subfields.
It may happen that a given person does not exist in the database and this is recognized only in the subfields.

Which is the correct output in your opinion?
- nullify only the given person (but return other if requested) and return null for the person not found (return an error / not return error)
- nullify all the query
- other proposals?
Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the person resolver and the subfields where missing database records are detected. Clarify the intended GraphQL behavior for a missing person, including whether to return partial data or errors; the issue is complete only after that behavior is agreed and implemented or documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.