matthewmueller / matthewmueller/graph.ql

Add example for loaders?

Open
#8 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
629
Forks
27
PR merge metrics
No merged PRs in 30d

Description

@matthewmueller can you add simple example for data fetching?

// an object of promises that fetch actual data
var loaders = require('./loaders')
...
Person: {
    films(person) {
      return loaders.film.loadMany(person.films)
    }
  },

How should look like loader? Should method loadMany return the usual promise?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced ./loaders module and the Person.films resolver example. Determine how a loader should be shown for data fetching and whether loadMany returns the usual promise. Done means the repository includes a simple loader example that answers both questions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.